ToolXkit Icon

JSON Formatter

Format, validate and minify JSON, with the error explained.

  • Free
  • No signup
  • Nothing uploaded
  • No watermark

Your JSON

Output

How to Use the JSON Formatter Online

JSON Formatter: before and after JSON A BEFORE JSON FORMATTER JSON A AFTER

JSON Formatter takes the single unbroken line an API hands you and adds the line breaks and indentation back, so you can read the structure. Pick 2 spaces, 4 spaces or tabs, sort the keys alphabetically, or minify back to one line for sending. When the JSON is broken, it reports the line, the column and what it expected there instead of just saying 'invalid'. Files of several hundred megabytes are handled.

JSON is what almost every web API speaks, and it usually arrives as one unbroken line. This adds the line breaks and indentation back so you can read the structure, and tells you the exact line and character when the JSON is malformed — which is the reason most people open a formatter in the first place.

No software to install Free Works on any device

Step-by-Step Guide to Using the JSON Formatter

  1. 1. Paste your JSON into the left panel

  2. 2. Choose an indent, or Minify to strip all whitespace

  3. 3. Copy the formatted result

    Any error is reported with its line and column.

No .json file to hand? Download a sample JSON file (3.5 KB) and try it.

Try it now

What is the JSON Formatter?

JSON is what almost every web API speaks, and it usually arrives as one unbroken line. This adds the line breaks and indentation back so you can read the structure, and tells you the exact line and character when the JSON is malformed — which is the reason most people open a formatter in the first place.

JSON file

.JSON

Format, validate and minify JSON, with the error explained.

At a glance

  • Takes: Pasted text or a .json file
  • Indent: 2 spaces, 4 spaces or tabs
  • Also: Minify to one line; sort keys A–Z
  • Errors: Line, column and what was expected
  • Size: Handles files of several hundred megabytes
  • Runs: In the browser tab — API responses and config files are never uploaded

See an Example

Before

{"id":42,"name":"Ada","tags":["engineer","author"],"active":true}

After

{
  "id": 42,
  "name": "Ada",
  "tags": [
    "engineer",
    "author"
  ],
  "active": true
}

Why Use Text Tools Online?

Counting words, changing case, pulling emails out of a page or writing an amount in words are small jobs that eat time by hand. These tools do them the moment you paste, and the text stays in your browser.

“Paste once, and let the tool do the fiddly part.”
  • Counts as you type
  • Lists sorted and cleaned
  • QR codes for anything
  • Cheque amounts in words
  • Case changed in one click
  • Emails and links pulled out
  • Citations in APA or Chicago
  • Handy commands for developers

Popular Uses for Text Utilities

Short, repetitive text jobs are what these tools were made for.

  • Essay word limits Check that an essay or application answer is within the word or character limit.
  • Fixing capital letters Turn text typed in CAPS LOCK into normal sentence case without retyping it.
  • Collecting contacts Pull every email address or phone number out of a long message or page.
  • Writing cheques Get a rupee or dollar amount written correctly in words for a cheque or invoice.
  • QR codes Make a QR code for a website link, contact card, email address or event.
  • Reference lists Format a book or website reference in APA or Chicago style for an assignment.
  • Tidying lists Sort lines alphabetically, remove repeats or add numbers to a pasted list.
  • Command helpers Build a cron schedule, git command or chmod setting without searching the manual.

What You Can Do with the JSON Formatter

Indent with 2 spaces, 4 spaces or tabs

Minify back to one line

Errors reported with the line, column and what was expected

Sort keys alphabetically

Handles files of several hundred megabytes

Why Use ToolXkit for JSON Formatter?

Your files stay with you

Everything runs inside your browser. Nothing you open or type is uploaded to a server.

Writing and Text Tools for Different Users

Students

Count words, format citations and tidy notes before submitting coursework.

Writers and bloggers

Change case, find repeated words and check length before publishing a piece.

Office workers

Clean up pasted lists, find and replace names and write amounts in words.

Marketers

Extract emails, links and hashtags from pages and make QR codes for campaigns.

Developers

Encode Base64, build cron lines and generate git and shell commands quickly.

Accountants

Write invoice and cheque amounts in words and tidy columns of pasted figures.

Best Times to Clean Up Text

Text tools save time when you are:

  • Keeping to a word limit
  • Fixing text typed in capitals
  • Building a contact list from emails
  • Writing out a cheque
  • Printing a QR code poster
  • Finishing a reference list
  • Removing repeats from a list
  • Setting up a scheduled job

Tips and Good to Know

  1. It formats JSON only. YAML, XML and JavaScript object literals with unquoted keys are reported as errors, not converted.

  2. Formatting changes whitespace and, if you choose it, key order. Values are untouched, but a system that depends on key order should not receive a sorted file.

  3. Trailing commas and single quotes are common reasons a file 'looks fine' but fails; the error message points at the exact spot.

Frequently Asked Questions

Answers to common questions about this tool.

It says my JSON is invalid but it looks fine.

The usual causes are a trailing comma after the last item, single quotes instead of double, or an unescaped quote inside a string. The error message names the line and character where parsing stopped, which is generally one position after the real mistake.

Does formatting change my data?

No. Only whitespace is added or removed — keys, values, types and order are untouched. Minifying and then formatting again returns exactly what you started with.

Is my text sent anywhere when I use JSON Formatter?

No. The text you paste is handled in your browser and never leaves the page. That makes it safe for drafts, customer lists and anything else you would rather keep to yourself.

Is there a limit on how much text I can paste?

The site sets none. Long documents are handled by your own device, so a whole book may be slow on an older phone. Articles, essays and long lists are no trouble.

Can I use JSON Formatter without making an account?

Yes. There is no login, no email to hand over and no daily limit. Open the page, paste or type, and copy or download the result when it is ready.

Why does my word count differ from Microsoft Word?

Programs treat hyphenated words, numbers and symbols a little differently. The gap is usually a few words in a long piece. If a teacher or portal sets a limit, stay a little under it to be safe.

Do the QR codes made here expire?

No. The information is stored directly in the pattern, with no redirect through our servers, so the code keeps working for as long as the link or text inside it stays valid.

Further reading

  • Unicode Consortium The body that sets how letters, symbols and emoji from every language are stored as text.
  • Letter case (Wikipedia) The rules and names for upper case, lower case, title case and the styles programmers use.
  • Base64 (MDN) A plain explanation of Base64, the encoding used to carry files and images as text.

More Text & Developer Tools

Other free tools for the same kind of job.

Browse all tools