Head — First N Lines

Keep just the first N lines of your text — like `head -n`. Choose the count, skip leading lines, and optionally number each line. Runs entirely in your browser, no server, no sign-up.

First lines

About this tool

Head keeps just the first lines of whatever text you paste — the same thing the Unix head -n command does, but in your browser with no install. Paste a log, a CSV, a giant export, or any block of text and instantly get back only the top rows.

What you can do

Windows line endings (CRLF) and a trailing newline are preserved, so the head of a file keeps its original structure.

Private by design

Everything runs locally in your browser via WebAssembly. Your text is never uploaded to a server — there's nothing to sign up for and nothing leaves your machine.

FAQ

What if I ask for more lines than the text has?

You simply get the whole text back — no error and no padding. Asking for the first 100 lines of a 20-line paste returns all 20 lines, same as head -n 100 on a short file.

Is there a maximum line count?

Yes: the count is clamped to the range 1 – 1,000,000. Leaving it empty uses the classic head default of 10 lines. Values outside the range are pulled back to the nearest bound rather than rejected.

How does skipping lines interact with line numbering?

Numbering always reflects the original position in your text. With Skip leading lines = 1 and Number of lines = 2, you get lines 2 and 3 prefixed 2⇥ and 3⇥ (a tab after the number, like cat -n) — not renumbered from 1.

Does it mangle Windows line endings or the final newline?

No. Lines are split on \n and any \r from CRLF endings is carried through untouched, and a trailing newline is kept only if your input ended with one — so the head of a file preserves the file's original structure byte-for-byte.

Developer & Automation Access

Run it from the terminal

Same engine as this page, headless — via the gizza CLI:

gizza tool head-lines "line 1
line 2
line 3
..."

New to the CLI? Get gizza →

Open it by URL

Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:

https://gizza.ai/tools/head-lines/?text=line%201%0Aline%202%0Aline%203%0A...&count=10&skip=0&number=true

Machine-readable descriptor: tool.json — title + parameters JSON Schema for agents.