JSON Validator, Formatter & Converter

Validate, auto-fix, beautify and convert JSON to XML, YAML, CSV, TypeScript, Python and Markdown. Free, no sign-up, and everything runs in your browser.

Input
Load ▾
Samples
Nodes

Instant validation

Errors show the exact line and column, and Auto-fix repairs trailing commas, unquoted keys, single quotes and comments.

10 output formats

Pretty, minified, escaped, XML, YAML, CSV, TypeScript, Python and Markdown. XML, YAML and CSV can be converted back to JSON, and a graph view maps the structure.

Private by design

Your data never leaves the page. Nothing is uploaded; history stays in your own browser.

What is a JSON validator, formatter and converter?

JSON (JavaScript Object Notation) is the plain-text format most APIs, config files and databases use to exchange data. It is simple, but one stray comma or quote makes the whole document unreadable to a program.

This free online tool gives you three jobs in one workspace. It validates your JSON and points to the exact error, it formats it so people (or machines) can read it easily, and it converts it to and from other formats such as XML, YAML, CSV, TypeScript, Python and Markdown.

Validator

Checks the syntax and shows line and column.

Formatter

Beautifies, minifies, indents and sorts keys.

Converter

Moves data between JSON and 10 output formats.

Broken input
{
  name: 'Broken',
  // comment
  items: [1, 2, 3,],
  ok: True,
}
↓ Auto-fix ↓
Valid JSON
{
  "name": "Broken",
  "items": [
    1,
    2,
    3
  ],
  "ok": true
}

What problems does it fix?

The everyday JSON headaches developers hit, and how each one is solved here.

The problemWhat you usually seeHow this tool helps
You cannot find the error“Unexpected token” with no obvious locationShows the line and column, highlights the line, and links straight to it.
Trailing commas, single quotes, unquoted keys, commentsParsers reject JSON that looks fine in JavaScript or PythonAuto-fix cleans them in one click.
Python or JS values in JSONTrue, False, None, undefinedAuto-fix converts them to true, false and null.
Unreadable one-line JSONA wall of text from an API or logBeautify, Tree and Graph views make it readable.
Escaped JSON inside a stringBackslashes and \" everywhereUnescape string reveals the real JSON; Escape string does the reverse.
Data needed in another formatYAML for config, XML for legacy systems, CSV for spreadsheetsConvert to XML, YAML, CSV, Python or a Markdown table, or convert them back to JSON.
Hand-writing typesSlow and error-prone for big responsesTypeScript output generates an interface from a sample payload.
Data does not match the contractMissing fields or wrong types slip throughSchema tab lists every mismatch.
“What changed between these responses?”Manual eyeballing of two payloadsCompare shows additions, removals and changes.
Pasting private data into unknown sitesTokens, customer data and internal payloads leave your machineEverything runs locally in your browser, so nothing you paste is uploaded.
Private by design
Your JSON is processed in your browser. Nothing is uploaded, so it is safe to inspect API responses and config while you work. History stays in your own browser and can be cleared any time.

Every feature, explained

What each button and tab means, and exactly how to use it.

Live validation

Checks your JSON on every keystroke and tells you whether it is valid.

HowType or paste. The status bar shows ✔ Valid plus size, lines, keys and depth, or the exact line and column of the error.

Error highlight & jump

Marks the broken line in the editor so you never hunt for a missing comma.

HowLook for the red line in the gutter, then use the jump link in the status bar to place the cursor on the problem.

Auto-fix

Repairs common mistakes: comments, trailing commas, single quotes, unquoted keys and True/False/None.

HowClick Auto-fix. The cleaned JSON replaces your input. Use Broken JSON in Load ▾ to try it.

Beautify & minify

Beautify adds indentation for reading. Minify strips all whitespace for the smallest payload.

HowClick Beautify or Minify, or press Ctrl/⌘+Enter (add Shift to minify).

Indent & sort keys

Choose 2 spaces, 4 spaces or tabs, and optionally sort every key alphabetically at all depths.

HowChange the Indent menu or tick Sort keys. Sorted keys make diffs and commits cleaner.

Escape / unescape string

Escape turns text into a quoted string with escape characters. Unescape reverses it.

HowPick Escape string or Unescape string in the output menu. Handy for JSON pasted from logs.

Load from anywhere

Bring data in by paste, file, drag-and-drop, URL or built-in samples.

HowUse Paste, or Load ▾ for Open file, From URL and Samples. You can also drop a file on the editor.

Four input formats

Start from JSON, YAML, XML or CSV and turn any of them into JSON or another format.

HowSet the Input menu first. Dropping a .yaml, .xml or .csv file switches it for you.

10 output formats

Pretty JSON, minified JSON, escaped and unescaped text, XML, YAML, CSV, TypeScript, Python dict and Markdown table.

HowOpen the format menu above the output and pick one. The output updates instantly.

Copy, download & chain

Take the result with you or feed it into another conversion.

HowCopy to clipboard, Download as converted.json/.xml/.yaml/.csv/.ts/.py/.md, or Use as input to convert again.

Size & stats

Shows the size of your input and of the output in the chosen format, with line counts and how much bigger or smaller the output is.

HowLook at the badge next to Input and the one beside the output format menu. Hover a badge to see the character count. Try Minify or CSV to watch the size drop.

Expand & collapse nodes

Fold any object, array or block to focus on the part you care about. It works on JSON, YAML, XML, TypeScript and Python output, and in the Tree view.

HowClick the small arrow beside a line number, or the “… lines” tag, to fold one node. Use Expand all, Collapse all or the depth menu (1 to 4 levels) to control everything at once.

Line numbers & word wrap

Line numbers stay correct while sections are folded, and Wrap makes long strings readable without side-scrolling.

HowTick Wrap under the output toolbar. Copy and Download always give you the full, unfolded text.

Tree view & search

Explore nested data by expanding and collapsing nodes, and search keys, values or JSONPath.

HowOpen the Tree tab, type text or a path such as $.items[*].name, then click a hit to copy its path. Expand all, Collapse all and the depth menu work here too.

Graph view

Draws your JSON as connected boxes so the shape of a large payload is obvious at a glance.

HowOpen Graph. Scroll to zoom, drag to pan, double-click to reset.

Schema check

Validates your data against a JSON Schema (draft-07 subset) and lists every mismatch.

HowOpen Schema, paste your schema, and read the results underneath.

Compare

Shows what was added, removed or changed between two JSON documents.

HowOpen Compare and paste the second JSON. Your input is the left side.

History

Remembers your last 15 conversions in this browser so you can get back to earlier work.

HowClick History, pick an entry to restore it, or Clear to wipe it.

Share link

Creates a link that reopens your JSON exactly as it is.

HowClick Share (inputs up to 3,000 characters). The link is copied to your clipboard.

Full screen & resizable panes

Gives you a bigger workspace and lets you rebalance the input and output panels.

HowClick Full screen (Esc exits) and drag the divider between the panels.

How to use the JSON converter and validator

Five steps from pasted text to a clean, converted result.

  1. 01

    Add your data

    Paste, open a file, drop one on the editor, load a URL or start from a sample. Pick the Input format first if it is not JSON.

  2. 02

    Read the status bar

    You get either ✔ Valid with size, lines, keys and depth, or the exact line and column of the problem.

  3. 03

    Fix or format

    Click Auto-fix for common mistakes, then Beautify or Minify. Set the indent and tick Sort keys if you want.

  4. 04

    Choose a view or format

    Switch between Output, Tree, Graph, Schema and Compare, and pick an output format such as YAML or CSV.

  5. 05

    Copy, download or continue

    Copy the result, download it as a file, or use it as the next input. Share or History if you need to come back.

Common workflows

Fix broken JSON

Copied from JavaScript, Python or a config file

  1. Paste it into the input.
  2. Read the error in the status bar.
  3. Click Auto-fix.
  4. Copy the clean result.

JSON to CSV for Excel

Turn an API array into a spreadsheet

  1. Paste a JSON array of objects.
  2. Choose CSV in the output menu.
  3. Click Download (converted.csv).
  4. Open it in Excel or Google Sheets.

Generate TypeScript types

Type an API response in seconds

  1. Paste a sample response.
  2. Choose TypeScript.
  3. Click Copy.
  4. Paste the interface into your code and rename Root.

Convert YAML config to JSON

Move between config formats

  1. Set Input to YAML.
  2. Paste or drop your .yaml file.
  3. Choose JSON (pretty).
  4. Copy or download the result.

Validate against a schema

Check a payload matches its contract

  1. Paste your JSON.
  2. Open the Schema tab.
  3. Paste your JSON Schema.
  4. Fix anything listed and re-check.

Compare two API responses

Spot exactly what changed

  1. Paste the first JSON as input.
  2. Open the Compare tab.
  3. Paste the second JSON.
  4. Read the +, − and ~ lines.

Output formats and when to use them

One JSON document, ten ways to use it. Below is the same data converted by this tool.

OutputWhat you getBest for
JSON (pretty)Indented, readable JSONDebugging, code review, docs
JSON (minified)All whitespace removedSmaller payloads, embedding in config
Escape stringJSON as a quoted, escaped stringPutting JSON inside another string or code
Unescape stringEscape sequences turned back into textReading JSON copied from logs
XMLNested elements under a root tagLegacy and SOAP-style integrations
YAMLIndented key: value configKubernetes, CI/CD, app config
CSVHeader row plus one row per objectExcel, Google Sheets, data import
TypeScriptAn export interface Root typeTyping API responses
Python dictA data = {…} literalScripts, tests, fixtures
Markdown tablePipe-separated tableREADMEs, docs, GitHub issues
Input JSON
{"id":101,"name":"Asha Rao","active":true,"tags":["api","json"],"address":{"city":"Mumbai","zip":"400001"}}
YAML
id: 101
name: Asha Rao
active: true
tags:
  - api
  - json
address:
  city: Mumbai
  zip: "400001"
TypeScript
export interface Root {
  id: number;
  name: string;
  active: boolean;
  tags: string[];
  address: {
    city: string;
    zip: string;
  };
}
XML
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <id>101</id>
  <name>Asha Rao</name>
  <active>true</active>
  <tags>api</tags>
  <tags>json</tags>
  <address>
    <city>Mumbai</city>
    <zip>400001</zip>
  </address>
</root>

Tip: CSV and Markdown table work best with an array of objects. Nested objects are flattened into dotted column names such as address.city.

Keyboard shortcuts

Small time-savers for heavy JSON days.

ShortcutWhat it does
Ctrl/⌘ + EnterBeautify
Ctrl/⌘ + Shift + EnterMinify
TabInsert one indent level in the editor
Esc, then TabLeave the editor with the keyboard (accessibility)
EscExit full screen
Double-click a tree nodeCopy its path

Frequently asked questions

Quick answers about validating, fixing and converting JSON.

What is a JSON validator?

A JSON validator checks whether text follows the JSON syntax rules and reports the exact line and column of the first problem. This tool validates as you type, so you know at once whether an API, app or config loader will be able to parse your JSON.

What is the difference between a JSON validator, formatter and converter?

A validator checks that JSON is correct. A formatter (beautifier or minifier) only changes whitespace so JSON is easier to read or smaller to send. A converter turns the same data into another format such as XML, YAML, CSV or TypeScript. This page does all three in one workspace.

Why is my JSON invalid?

The usual causes are trailing commas, single quotes instead of double quotes, unquoted keys, comments, missing commas or brackets, and Python-style True, False or None. The status bar shows the line and column, and the Auto-fix button repairs the common syntax mistakes in one click.

Does Auto-fix change my data?

Auto-fix repairs syntax only: it removes comments and trailing commas, converts single quotes to double quotes, quotes bare keys, and turns True, False, None and undefined into true, false and null. Values are not otherwise rewritten, but review the result before you use it. Structural errors such as a missing bracket cannot be repaired automatically.

How do I convert JSON to CSV?

Paste a JSON array of objects, choose CSV in the output format menu, then use Copy or Download (the file is saved as converted.csv). Nested objects are flattened into dotted column names such as address.city, and nested arrays are kept as JSON text inside the cell.

Can I convert XML, YAML or CSV back to JSON?

Yes. Set the Input menu to YAML, XML or CSV, paste your data or drop a .yaml, .xml or .csv file, and choose JSON as the output. The Use as input button lets you chain one conversion into the next.

How do I expand or collapse all nodes in JSON?

In the Output tab use Expand all, Collapse all or the depth menu to open a set number of levels, or click the arrow next to any line to fold just that node. The same controls are in the Tree tab. Folding only changes what you see: Copy and Download always use the full text. The input box is an editable text area, so use Beautify and then fold in the Output or Tree tab.

How can I see the size of my JSON?

The Input panel shows the size and line count of what you pasted, and the output toolbar shows the size of the converted result and its percentage change against the input. Hover either badge for the character count.

What is JSONPath and how do I use it here?

JSONPath is a query syntax for picking values out of JSON, for example $.items[*].name returns the name of every item. Open the Tree tab, type the expression into the search box, and click a result to copy its path. Plain text search on keys and values works too.

Is my data uploaded or stored anywhere?

No. Validation and conversion run in your browser and nothing you paste is sent to a server. History is kept only in your own browser storage and can be cleared at any time. Two features touch the network only when you use them: From URL fetches the address you type directly from your browser, and Share places your data in the link itself, so anyone you give that link to can read it.

Is there a size limit?

There is no fixed limit, but because everything runs locally, very large files depend on your device's memory. History skips inputs over 200,000 characters and Share links work for inputs up to 3,000 characters, so use Download for bigger data.

Which JSON Schema features does the Schema tab support?

It supports a practical draft-07 subset: type, required, properties, items, enum, minimum and maximum, string and array length limits, pattern, additionalProperties and anyOf. Each mismatch is listed with where it occurred in your data.

Is the tool free?

Yes. It is free to use, with no account or sign-up required.

Building something with JSON?

Need sample data to test with? Try our Mock Data Generator. Explore more free developer tools, read our tutorials, or talk to us about custom tools and APIs.