Skip to content
OnlineToolStudio

Remove Line Numbers

runs in your browserno sign-upfree

Strip line numbers from code copied from tutorials, PDFs or editors — keeping the indentation — or from any numbered list.

Removed 5 line numbers

5 lines

About this tool

Copied code from a tutorial, a PDF or a code viewer and got line numbers with it? Paste it here to strip them off. Only numbers that count up one by one are removed, so text that just starts with a number — like “2024 was a good year” — is left alone, and code keeps its original indentation. Works with 1. 1) 1: [1], tab-separated and editor-style numbers.

How to use

  1. Paste the numbered text or code.
  2. Check the result — the status shows how many numbers were removed.
  3. Copy or download the clean text.

FAQ

Will it remove numbers that are part of my text?

Not normally. It looks for the longest run of line numbers that count up (1, 2, 3…) and removes only those. If your numbers are out of order on purpose, tick “Remove any leading number”.

Is my code’s indentation kept?

Yes. Only the number and the gap that follows it on every numbered line are removed, so the spaces your code was indented with stay exactly as they were.

Why does code copied from a PDF still look wrong?

PDFs often lose indentation or join lines when copied. After removing the numbers, run the code through a formatter (for example the JavaScript, JSON or SQL formatter) to tidy it up.

Related tools

All tools