CSV Sequence Generator
A column of numbers, or of identifiers built from numbers. Set a start, an end and a step, add zero padding, put a prefix and a suffix around it, and you have INV-0001-2026 through INV-5000-2026 in one go. Decimal steps are computed in integers, so nothing comes out as 0.30000000000000004.
A hundred numbers are generated the moment the page loads. Change any field and it regenerates.
The floating point problem, and why it shows up here
Ask most tools for a sequence from 0 to 1 in steps of 0.1 and you get this, because binary floating point cannot represent 0.1 exactly and the errors accumulate as the loop adds:
0
0.1
0.2
0.30000000000000004
0.4
0.5
0.6000000000000001
0.7000000000000001
That is not a display bug. Those are the values, and they will be in the file you download, and they will fail an equality comparison in whatever reads it.
The fix is to never accumulate in floating point. The start and the step are scaled to integers by the number of decimal places involved, the loop counts in integers, and the division back happens once per value:
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
Which is what was asked for. Trailing zeros are kept consistent too, so a sequence with one decimal place has one decimal place all the way down rather than switching to 1 at the end.
Building identifiers, not just counting
The prefix, suffix and zero-padding controls are what turn a counter into something usable as a key. Padding matters more than it looks: a zero-padded id sorts correctly as text, and an unpadded one does not.
unpadded, sorted as text padded, sorted as text
INV-1 INV-0001
INV-10 INV-0002
INV-100 INV-0003
INV-2 ...
INV-20 INV-0010
INV-3 INV-0100
The left-hand column is what every filesystem, every spreadsheet sort and every alphabetical index will do to unpadded ids. The right-hand one is why invoice numbers have leading zeros.
A negative number keeps its minus sign outside the padding, so -2 padded to three digits is -002 rather than 0-02. Small thing, and getting it wrong produces ids that no system will accept.
What people generate here
- A primary key column for a test fixture, 1 to 50,000, no padding, no prefix.
- Invoice or order numbers,
INV-plus five padded digits, to fill a demo dataset that has to look plausible. - A row-number column to join against, when the file you have has no key of its own.
- SKU codes, a prefix per category and a padded counter.
- A bucket or a scale, 0 to 1 in steps of 0.05, for a lookup table or a chart axis.
- Port numbers, seat numbers, ticket numbers, anything where the answer is "the numbers from here to there".
Descending ranges work: put the end below the start and it counts down, with a note. That is the quickest way to a "most recent first" ordering column.
Five output formats, and why the plain list matters
CSV with a header is the default and is right for a spreadsheet or an import. The one worth knowing about is Plain list, which emits the values with no header and nothing else:
1001
1002
1003
1004
That is the form you paste into an SQL IN clause, feed to a shell loop, or drop into a config file's list of allowed values. A header row in any of those places is a bug, and stripping it by hand is the sort of small friction that makes people write a script instead of using a tool.
When a counter is not enough
This page makes one column. For a table where the id column sits alongside names, emails, dates, categories and money that all agree with each other, the full test data generator is the page: 33 field types, per-field options including id prefixes and padding, weighted value lists, and a seed so the same settings give the same data twice.
It shares this page's million-row ceiling and adds twelve more output formats, including Parquet, SQLite and DuckDB.
Frequently Asked Questions
Does it include the end value?
When the step lands on it, yes. From 1 to 10 by 1 gives ten rows ending at 10. From 1 to 10 by 3 gives 1, 4, 7 and 10. From 1 to 11 by 3 gives 1, 4, 7 and 10 again, because 13 is past the end.
Can the step be a decimal?
Yes, and it will not produce floating point noise. The arithmetic is done in scaled integers and divided once per value, so 0 to 1 by 0.1 gives exactly one decimal place on every row and no 0.30000000000000004.
How do I make it count down?
Put the end below the start. The step is always taken as a positive size and the direction comes from the range, so a start of 100 and an end of 1 counts down by whatever step you set. A note above the result says it is descending.
What is the row limit?
A million. Not a marketing number: it is the same ceiling the full test data generator uses, and the page really will produce a million rows in your browser. Most tools of this kind stop between five thousand and a hundred thousand. Above a hundred thousand the page warns you that saving the file takes a moment, because it does.
Why does my padded negative number look right?
Because the minus sign is kept outside the padding: -2 padded to three digits is -002. Padding the whole string including the sign gives 0-02, which is not a number to anything.
Can I put text on both sides of the number?
Yes. The prefix goes in front and the suffix behind, so a prefix of INV-, four digits of padding and a suffix of -2026 gives INV-0001-2026. Both boxes take any text, including spaces.
Does anything I paste leave my computer?
No. There is no upload endpoint on this page and no network request in the code that does the work. JavaScript in your own tab reads the text, processes it and hands back the result. Nothing is stored between visits either, so reloading gives you an empty box again. You can confirm it by opening your browser's network panel and watching it stay quiet while you work.
Related
Counting, done correctly
Free, no account, nothing transmitted. Padding, prefixes and decimal steps that come out clean.
Back to the generator