Numbers to Array

Numbers to Array Converter

Built for numeric data.

Convert the numbers

Numbers to Array Converter

0 items / 0 unique
Input Text
0 characters Ctrl+Enter to convert - Drag and drop .txt
Split Input By
Numeric handling
Cleaning Options
Output
Output Format
JSON options
Customization
Output 0 unique Output
// Your converted output will appear here.
Paste text and click Convert Text, or use Ctrl+Enter.
Your text stays private. All conversion happens locally in your browser using JavaScript. Nothing is uploaded to any server.

Values stay unquoted, sorting is numeric rather than alphabetical, non-numeric entries can be filtered out, and a summary reports count, min, max, sum, mean and median.

How It Works

How to use the Numbers to Array Converter

  1. Paste the numbers

    One per line, or switch the delimiter for a comma-separated row.

  2. Filter and sort

    Numeric values only drops anything that is not a number. Numeric sort orders by value, not by text.

  3. Read the summary

    Count, min, max, sum, mean and median update with the output, along with a count of anything skipped.

Examples

Numbers to Array Converter examples

Unquoted numeric JSON

Input

42
7
-13
1024
3.5

Output

[
  42,
  7,
  -13,
  1024,
  3.5
]

Sorted numerically, ascending

Input

42
7
-13
1024
3.5

Output

[
  -13,
  3.5,
  7,
  42,
  1024
]

Alphabetical sorting would put 1024 before 42, because it compares the first character of each.

Mixed input with the numeric filter on

Input

10
n/a
20
unknown
30

Output

[
  10,
  20,
  30
]

Non-numeric rows are dropped and counted in the summary.

Notes

Working with numbers to array

Why alphabetical sorting ruins numbers

JavaScript's default Array.sort() converts everything to strings, so [42, 7, 1024] sorts to [1024, 42, 7]. Numeric sort here compares values, and the generated array is in the order shown. If you sort in your own code, pass a comparator rather than relying on the default.

What counts as a number

Integers, decimals, leading minus signs and scientific notation such as 1.2e-5 are all recognised. Thousands separators are not — 1,000 reads as two values under a comma delimiter, or as non-numeric under a newline one. Strip the separators before pasting.

Identifiers are not numbers

ZIP codes, phone numbers and account IDs look numeric but must stay strings: a leading zero disappears the moment the value is treated as a number, and a twenty-digit ID loses precision past the safe integer limit. For those, turn the numeric type off so the values stay quoted.

FAQ

Numbers to Array Converter FAQs

Numbers to Array Converter

Built for numeric data. Values stay unquoted, sorting is numeric rather than alphabetical, non-numeric entries can be filtered out, and a summary reports count, min, max, sum, mean and median.