Text Studio · Windows 10 and 11

Add line numbers to text

Choose Number the lines and every line gets its number, padded so that 9 and 10 line up. Going the other way, Remove numbers and bullets strips 1., 2) and • marks off a list you pasted, ready to sort or number again.

Updated

How to add line numbers

  1. 1

    Paste the lines

    Paste the text or list into Text Studio, or open its file with Open.

  2. 2

    Pick the lines

    Select the lines to number. Without a selection, every line in the text gets a number.

  3. 3

    Number them

    Open Lines and choose Number the lines under Tidy. Each line now starts with its number, a full stop and a space.

  4. 4

    Renumber later

    After you add, move or delete lines, choose Remove numbers and bullets, then Number the lines again.

What the numbers look like

Each line gets its number, a full stop and a space. The numbers are padded on the left to the width of the largest, so in a text of 120 lines the first reads “  1.” and the last “120.”, and the text after them starts in one straight column. Turn on Typewriter font in View, where every character is the same width, and the columns line up exactly.

  • Every line is numbered, empty ones included. Run Remove empty lines first if only lines with text should count.
  • A selection is numbered on its own, starting from 1, so you can number one section of a document and leave the rest alone.
  • Numbering always starts at 1 and always uses the 1. style.
  • The numbers are written into the lines as they are now. They do not update themselves when you add or remove a line, which is what renumbering, below, is for.

When numbered lines help

  • Reviewing a draft. “Line 14 needs a source” is quicker to act on than a quoted half-sentence.
  • Sharing code or a config file in an email or a chat, where the reader needs to point at a line.
  • Poems, scripts and transcripts for a class, a rehearsal or an interview analysis.
  • Questions, steps and options in a survey, a quiz or instructions you paste into a form.

Because the numbers become part of the text, they travel wherever you paste it. The line numbers Word can show in the margin (Layout, Line Numbers) are different: they belong to the document's layout and do not come along when you copy the text.

For a printed handout, number the lines here and paste the result into Documents or Word: the numbers arrive as ordinary text, ready to print with the rest.

Removing numbers and bullets

Remove numbers and bullets strips the marker from the start of each line, with the spaces before and after it:

LineAfter
1. ApplesApples
2) PearsPears
3: PlumsPlums
• Figs, - Kiwi or * DatesFigs, Kiwi, Dates
a) Limes, iv. LemonsUnchanged: letters and Roman numerals stay
1.5 kg flourUnchanged: no space after the number

Only a marker at the very start of a line counts, so a number later in the line, as in “Step 2. Mix the flour”, is never touched, and a line with two markers, such as “1. - Apples”, loses only the first; choose the command again for the second. Watch for lines that really start with a number and a colon: “2024: a record year” loses its “2024:”. The spaces after a marker go with it, so any indentation that followed the number does not survive the round trip.

Renumbering a list

Numbers typed by hand go wrong as soon as a list changes. In Text Studio the fix takes two clicks: Remove numbers and bullets, then Number the lines. The same pair turns a bulleted list from a web page or a chat into a numbered one, and with A to Z in between, a jumbled list comes out alphabetical and numbered.

Lists copied from Word or a PDF often arrive with a tab after each number, and sometimes with the numbers missing entirely. Both are fine: the tab is removed along with the number, and a list without numbers simply gets them.

Stripping is useful on its own, too. Lists pasted from a chat or a slide often carry dashes and bullets that a spreadsheet column, a form or a mailing tool does not want; one click leaves just the items.

Questions, answered

Can numbering start at a number other than 1?

No. It always starts at 1 for the lines you number, whether that is the whole text or a selection.

Can I use 1) instead of 1.?

Yes, with find and replace. Turn on Pattern, find (^|\n)(\s*\d+)\., replace with $1$2) and choose Replace all.

Can it number paragraphs instead of lines?

In Text Studio a paragraph typed without pressing Enter is one line, even when it wraps on screen, so each paragraph gets one number. The empty lines between paragraphs are numbered too, so remove them first.

Is it good for sharing code?

For showing code in a message or a document, yes: the padding keeps the lines aligned in a typewriter font. Share the numbered copy and keep the original for running.

Can I number the lines of a file and keep the original?

Yes. Open the file, number the lines, then press Ctrl Shift S to save the numbered version under a new name. The original file stays as it was.

Do I need an internet connection?

No. Numbering and stripping happen in Text Studio on your computer, with or without one.

Add line numbers, and 16 more apps.

Download for Windows

7 days free, then from $3.99 a month for all 17 apps. Windows 10 and 11.