jsonlkit.com
JSONL (JSON Lines) utilities, in the browser
Say hi →

JSONL Formatter

updated 25 April 2026

100% client-side. No upload.

Format

Drop a .jsonl file here, or

JSONL Formatter

Pretty-print each line of a JSONL file with a configurable indent, or minify it back down. Useful for eyeballing a small dataset without pulling it into an editor.

Before you start

You need a .jsonl or .ndjson file, or a snippet of JSON Lines text to paste. Technically, this tool also works on regular JSON files, but it's designed to handle multiple JSON objects separated by newlines.

Keep in mind that "Pretty-printed JSONL" is a bit of a contradiction. The JSONL specification requires every record to live on a single line. When you use this tool to "pretty print," it will expand those records across multiple lines for readability. I built this so you can actually read your data, but remember: you'll need to Minify it back down before feeding it into a database or an AI training pipeline.

There is no hard file size limit, but everything happens in your browser's memory. For files over 50 MB, you might notice some lag while the textareas render. If you're dealing with gigabyte-scale logs, a CLI tool is still your best bet.

How to use it

  1. Paste your JSONL text into the Input pane, or drop a file onto the page.
  2. Set your preferred Indent (usually 2 or 4 spaces).
  3. Click Pretty print to expand the JSON objects into a human-readable format.
  4. If you're cleaning up a file for production, click Minify to collapse everything back to one line per record.
  5. Check the status bar for any line-specific syntax errors.
  6. Click Copy or Download to save your work.

Options explained

Indent

This sets the number of spaces used for nesting. I've capped this at 8 spaces to keep the output from flying off the right side of your screen. 0 indent is essentially a "pretty minify" where you get newlines between keys but no horizontal spacing.

Pretty print vs. Minify

Pretty print uses JSON.stringify to add whitespace and newlines within each object. It's great for debugging or manual editing. Minify removes all internal whitespace, ensuring each object occupies exactly one line of text, which is the standard format for NDJSON.

Example

Input (Minified):

{"id":1,"user":"alice","meta":{"v":1}}
{"id":2,"user":"guest","meta":{"v":1}}

Output (Pretty print, 2-space indent):

{
  "id": 1,
  "user": "alice",
  "meta": {
    "v": 1
  }
}

{
  "id": 2,
  "user": "guest",
  "meta": {
    "v": 1
  }
}

Tips & common pitfalls

Troubleshooting

I get "Unexpected token" errors on every line.

Check if you're actually pasting a JSON array (starts with [ and ends with ]). If so, use the JSONL ↔ JSON Array tool to convert it to lines first.

The "Copy" button isn't working.

If your file is massive, the browser's clipboard API might struggle. Try clicking Download instead to save the output directly to a file.

Why are there extra newlines between my pretty-printed objects?

I add a double newline between formatted records to make them easier to distinguish visually. These disappear completely when you switch back to Minify mode.

Related tools

See also: if you need to do something adjacent on this site, try JSONL to CSV to flatten JSONL into a CSV with dotted keys, JSONL to JSON to convert JSONL into a JSON array (or back), or OpenAI Fine Tune Validator to validate an OpenAI fine-tune file against the chat schema.

Frequently asked questions

Is pretty-printed JSONL still valid for production?

Almost certainly not. The NDJSON and JSONL standards require each record to be a single line. This tool's "Pretty" mode is strictly for humans to read; use "Minify" for machines.

Can I use Tabs for indentation?

Currently, no. I've standardized on spaces because that's how the underlying JavaScript engine handles formatting. If you need tabs, you'll need to run a find-and-replace on the output.

Does this tool handle Unicode or special characters?

Yes. The tool uses standard browser encoding. Non-ASCII characters (like emojis or non-Latin scripts) are preserved as-is unless they were already escaped in your source text.

Is my data sent to a server?

Never. I built this to run entirely in your browser's JavaScript engine. Your data stays on your machine, which makes it safe for sensitive logs or private AI training data. Check the privacy policy if you're curious.

What is the difference between JSONL and NDJSON?

For 99% of use cases, they are identical. Both represent a stream of JSON objects separated by newlines. JSONL is the name used by the formal spec, while NDJSON (Newline Delimited JSON) is often used in data engineering circles.