JSON formatter & beautifier

JSON Formatter Online – Beautify and Pretty Print JSON Instantly

Turn minified or messy JSON into clean, readable, indented output — or minify it back down. Sort keys, remove empty and null values, choose your indentation and format live as you type, right in your browser.

  • 100% offline
  • Privacy first
  • Live formatting

Part of the Captain JSON toolkit — 20+ JSON tools in one extension.

Example: minified JSON, pretty printed

Illustrative example
Minified input
{"name":"Ada","roles":["qa","dev"],"active":true,"email":null,"address":{"city":"Pune","zip":"411001"}}
Pretty printed · 2 spaces
{  "name": "Ada",  "roles": [    "qa",    "dev"  ],  "active": true,  "email": null,  "address": {    "city": "Pune",    "zip": "411001"  }}
Cross Browser Support

Available Across All Major Browsers

Your JSON toolkit. Wherever you develop.

Captain JSON is designed to fit into your everyday development workflow. Access your JSON productivity toolkit through your preferred browser and make JSON formatting, comparison, and validation easier.

Available today: Google Chrome, Microsoft Edge and Mozilla Firefox. More browsers are coming soon.

What is a JSON formatter?

A JSON formatter, also called a JSON beautifier or pretty printer, re-indents JSON text so its structure is easy to read. Pretty printing changes only whitespace, not the data. Captain JSON’s JSON Formatter can pretty print, minify, sort object keys alphabetically and remove empty values, null values and duplicate keys — and it formats live as you type, all in your browser.

About Captain JSON: Captain JSON is a browser extension by PiratesOfBugs that provides JSON developer utilities including JSON comparison, formatting, pretty printing and validation.

Features

JSON formatter features

Pretty print, minify and tidy JSON — with the options developers actually reach for.

  • Pretty format JSON

    Indent nested objects and arrays so the structure is obvious at a glance.

  • Minify JSON

    Strip unnecessary whitespace for compact request bodies and storage.

  • Sort object keys alphabetically

    A consistent key order makes JSON easier to scan, review and compare.

  • Remove empty values

    Clean empty values out of the formatted output.

  • Remove null values

    Drop properties whose value is null.

  • Remove duplicate keys

    Clean up objects that repeat the same key.

  • Choose indentation

    Pick the indentation you prefer, such as 2 or 4 spaces.

  • Live formatting while typing

    The formatted output updates as you edit.

  • Copy or download output

    Copy the result to your clipboard or download the formatted JSON.

Problem & solution

Why minified JSON is hard to work with

The problem

APIs, logs and config systems often emit JSON as a single minified line. Reading it means scrolling sideways, counting brackets and hoping you don’t miss a comma — and pasting it into a ticket or a doc only makes it worse.

How Captain JSON helps

Captain JSON reformats it into clean, indented text in an instant. Need the opposite for a request body or storage? Minify it. Sort keys and remove nulls so the output is consistent before it goes into a code review or a document.

  • Choose your own indentation
  • Live formatting as you type
  • Copy or download the result
Use cases

What teams use the JSON formatter for

Readable JSON saves time anywhere a person has to look at it.

  • API debugging

    Beautify a minified API response so you can read nested objects, spot a wrong value and trace a bug.

  • Log analysis

    Structured logs are often one dense line of JSON. Pretty print an entry to read its fields at a glance.

  • Code reviews

    Sort keys and use consistent indentation so JSON fixtures and config files produce small, reviewable diffs.

  • Documentation

    Format example requests and responses so the JSON in your docs, READMEs and tickets is clean and consistent.

  • Sharing readable JSON

    Tidy a payload before pasting it into a chat, an issue or an email so your teammates can actually read it.

How to use

How to format JSON with Captain JSON

Four quick steps from messy to readable.

  1. Step 1

    Install and open Captain JSON

    Add the extension from the Chrome Web Store or Firefox Add-ons and open it from your browser toolbar.

  2. Step 2

    Open the Formatter

    Choose Formatter in the Captain JSON workspace, then paste or upload your JSON.

  3. Step 3

    Choose how to format it

    Pretty print or minify, pick your indentation, and optionally sort keys or remove empty values, null values and duplicate keys.

  4. Step 4

    Copy or download the result

    Copy the output to your clipboard or download it. With live formatting, the output updates as you edit.

Examples

One input, three outputs

These illustrative examples show how the same JSON looks with different formatter options. They are examples, not screenshots of the extension.

Pretty print, minify, or clean up

Illustrative example

The same data, three ways: compact as an API sends it, pretty printed to read, and with keys sorted and nulls removed.

Minified input
{"name":"Ada","roles":["qa","dev"],"active":true,"email":null,"address":{"city":"Pune","zip":"411001"}}
Pretty printed · 2 spaces
{  "name": "Ada",  "roles": [    "qa",    "dev"  ],  "active": true,  "email": null,  "address": {    "city": "Pune",    "zip": "411001"  }}
Sorted keys · nulls removed
{  "active": true,  "address": {    "city": "Pune",    "zip": "411001"  },  "name": "Ada",  "roles": [    "qa",    "dev"  ]}

Indentation is your choice

Illustrative example

Pretty printing uses the indentation you prefer — for example 2 or 4 spaces — without changing the data.

2 spaces
{  "id": 7,  "ok": true,  "meta": {    "v": 1  }}
4 spaces
{    "id": 7,    "ok": true,    "meta": {        "v": 1    }}
FAQ

JSON formatter: frequently asked questions

How do I format JSON online?

Open Captain JSON, choose the Formatter, and paste or upload your JSON. It is pretty printed with the indentation you choose, and with live formatting the output updates as you type. Copy the result or download it. Everything runs in your browser.

What does it mean to pretty print or beautify JSON?

Pretty printing, also called beautifying, adds line breaks and indentation so nested objects and arrays are easy to read. It changes only whitespace, not the data. Captain JSON’s formatter pretty prints with the indentation you pick, such as 2 or 4 spaces.

How do I minify JSON?

Choose the minify option in the Formatter. Minifying removes unnecessary whitespace and line breaks so the JSON is as compact as possible — handy for request bodies and storage. It is the reverse of pretty printing and doesn’t change the data.

Can I sort JSON keys alphabetically?

Yes. Captain JSON can sort object keys alphabetically. A consistent key order makes JSON easier to scan and review, and it makes JSON compare results easier to read. In JSON an object is an unordered collection, so sorting doesn’t change its meaning for most consumers.

How do I remove null or empty values from JSON?

Use the formatter’s cleanup options to remove null values or empty values from the output, and to remove duplicate keys. These options change the content, so review the output before using it anywhere that expects every field to be present.

Can Captain JSON format large JSON files?

Captain JSON has been tested with files over 30MB, staying smooth for editing, formatting, searching, validating and comparing — including deeply nested objects and arrays.

Does the formatter send my JSON to a server?

No. Captain JSON runs entirely inside your browser. Your JSON is parsed and formatted locally — nothing is uploaded or stored on a server.

Why won’t my JSON format?

A formatter has to parse JSON before it can re-indent it, so a syntax error — such as a trailing comma, a missing quote or a mismatched bracket — stops formatting. Check the input with the JSON validator, which shows the line and column of the error.

Make your JSON readable

Install Captain JSON and beautify, pretty print or minify your next payload right in your browser.

  • ✓ 100% Offline
  • ✓ Privacy First
  • ✓ Lightweight

Need more than JSON Formatter? Explore all 20+ Captain JSON tools.

We use analytics cookies to understand how the site is used. No personal data is sold. See our privacy practices before choosing.