Files

File Head and Tail Viewer

Shows the first and last lines of a file with their line numbers, and nothing in between.

Loading the tool…

Processing happens locally in your browser. What you paste or load is processed by this page and is not uploaded to a server. Nothing is stored unless you use a control that says it stores something, and you can clear anything this site has kept from the privacy page.

How to use this tool

  1. Load the file with the picker below the box.
  2. Set how many lines you want from each end, and whether you want the top, the bottom or both.
  3. Select Show the ends.
  4. Turn line numbers off when you want to copy the lines out into another tool.

What file head and tail viewer does

The two ends of a file answer most first questions about it. The top tells you whether there is a header and what the columns are called; the bottom tells you whether the export finished or was cut off mid-record, and whether there is a trailer line that will break a parser. Everything between them is usually irrelevant to that first look, and on a large file it is what makes an editor unusable.

This is head and tail without a terminal. Choose how many lines, choose whether you want the top, the bottom or both, and the result shows exactly those with their real line numbers and a note of how many lines were skipped in the middle. Line numbers are on by default and can be turned off when you want to copy the content out cleanly. The file picker reads the file in your browser, so nothing is uploaded.

Frequently asked questions

Because on a large export it cannot, or not quickly. The two ends answer most first questions — is there a header, what are the columns called, did the export finish or stop mid-record — and this shows them without loading the middle into an editor.

Yes. The numbers shown against the last lines are their positions in the whole file, not in the excerpt, and the marker in the middle says how many lines were skipped between the two ends.

You get the whole file with a note saying so, rather than the same lines repeated at both ends.

It splits on CRLF, LF and bare CR, so a file written on Windows and one written on a Mac count the same way. A trailing newline at the end of the file is treated as a terminator rather than an extra empty line.