FileGizmo Text tools
Number lines, add a prefix or suffix
Add line numbers that stay aligned past the ninth line, choose where the count starts, and wrap every line in a prefix or a suffix of your own.
Complete
Your result is ready
Simple by design
Number lines in three steps
Numbering a list is the kind of task that seems too small to need a tool right up to the moment it involves two hundred lines.
The part worth getting right is alignment. Numbers grow a digit at a time, so the tenth line of an unpadded list shifts one column to the right of the ninth, and the hundredth shifts again. In a numbered list the whole reason for the number is that the eye can run down the column, and a ragged column defeats it. FileGizmo pads the numbers so the text after them starts in the same place on every line.
The padding is calculated from the largest number that will actually be printed, not from the number of lines. Those are the same thing only when the count starts at one. Nine lines starting at 995 need three columns, and a tool that sized the padding from the line count would give them one and produce exactly the ragged output the padding exists to prevent. It is a small detail, and it is the one that separates a tool somebody keeps from a tool they use once.
Where the count starts is free, which matters when the text being numbered is an extract. A block lifted from the middle of a file can be numbered from the line it actually came from, so the numbers agree with the source rather than restarting at one and quietly disagreeing with everything else.
Blank lines keep their place without consuming a number, by default. A list with paragraph breaks in it should not have those breaks counted as items. Turning that off numbers every line without exception, which is what a faithful line-by-line listing needs.
The prefix and suffix are applied to every line and work with or without numbering. With numbering off, this becomes the fastest way to quote a block for an email, add a bullet character to every line, wrap each line in a pair of tags, or turn a plain list into markup. With numbering on, the prefix sits before the number and the suffix after the text.
The separator between the number and the line is yours to set, and defaults to a full stop and a space. Everything happens in this tab, and the list is never uploaded.
- 1
Paste a list a checklist or a block of code
- 2
Set the starting number and any prefix or suffix
- 3
Press Number the lines and copy or download the result
Good to know
Frequently asked questions
Why do the numbers have spaces in front of them?
So the text after them lines up. Without padding, line 10 shifts a column to the right of line 9 and the list stops aligning, which for a numbered list is most of the point. Padding can be turned off.
Can I start at a number other than one?
Yes. The starting number is free, and the padding is calculated from the largest number that will actually be printed, so nine lines starting at 995 are padded to three digits rather than one.
Are blank lines numbered?
Not by default. They keep their position in the output but do not consume a number, which is usually what a list with paragraph breaks needs. This can be turned off.
Can I add a prefix without numbering?
Yes. Turn the numbering off and only the prefix and suffix are applied, which is how to quote a block, add a bullet, or wrap each line in markup.
Learn more