Skip to content
Tezmy Tools

Extract Line Range

Take lines from one line number to another out of a text

3 of 6 lines taken.

Runs in your browser. Nothing is uploaded.

About the Extract Line Range

Sometimes you need only a slice of a long text: lines 100 to 150 of a log, the first ten lines of a list, or everything after line 20. This tool takes a range of lines by number. Enter the first line, and the last line if you want one; leave the last empty to take everything to the end. Lines are counted from 1, blank lines count as lines, and a note tells you how many lines were taken out of how many. The text is processed in your browser and is not uploaded.

Updated October 2026

How to use the Extract Line Range

  1. 1Paste your text into the left box.
  2. 2Enter the number of the first line.
  3. 3Enter the last line, or leave it empty to go to the end.
  4. 4Read the lines on the right and the note below.
  5. 5Copy the lines or download them.

Why take a range

Logs, exports and code files can be very long. Often you only need the part around an error, a block you already know the position of, or the header lines at the top. Cutting by line number is precise and repeatable, so you can share just the relevant part.

Editors show line numbers, so you can read them off and type them here.

    How the numbers work

    Line 1 is the first line. The last line number is included in the result. If you type a first line larger than the last, the tool explains the problem. A trailing blank line at the end of a file is not counted as an extra line.

    • From 1 to 10: the first ten lines
    • From 50: everything after line 49
    • Same number twice: one line

    Tips

    Paste the text exactly as it is; changes to line breaks change the numbering. For finding which lines contain a word first, use the Filter Text Lines tool, then extract a range from the result.

      Example

      Take a text of six lines and ask for lines 2 to 4: the tool returns the second, third and fourth lines and tells you that 3 of 6 lines were taken. Leave the last line empty and ask for line 4 onwards, and you get lines 4, 5 and 6.

      Because the numbering matches the numbers in a code editor, you can read a range off the editor and type it here.

        Phone and computer

        On a phone, paste into the box, adjust the line numbers, and tap Copy to carry the result into another app. On a computer you can also download it as a file. The two boxes sit side by side on a wide screen and one above the other on a narrow one, so you can compare input and result without zooming. Nothing you paste is uploaded or stored. To number the lines first, use Add Line Numbers to Text, and use Head and Tail Text for a quick first or last few lines.

          Features

          • Any range of lines
          • Open-ended range to the end
          • Counts from line 1
          • Clear errors for impossible ranges
          • Shows lines taken and total
          • Private: nothing is uploaded

          Frequently asked questions

          How do I get lines 10 to 20 of a text?

          Paste the text, enter 10 as the first line and 20 as the last. The lines appear on the right.

          How do I take everything after a certain line?

          Enter the first line and leave the last empty.

          Do blank lines count?

          Yes. Every line counts, empty or not, because that is how line numbers work in an editor.

          What if my range is longer than the text?

          If the last line is beyond the end, you get everything to the end. If the first line is beyond the end, you see a message with the number of lines in the text.

          Is this the same as head and tail?

          Head and tail take lines from one end. A range can start anywhere. For the ends, use the Head and Tail Text tool.

          Is my text uploaded?

          No. Everything stays in your browser.

          Related tools