jsonecho

JSON Formatter and Validator

Paste your JSON, get it cleaned up and checked. If something is broken, we show you the exact line and what is wrong.

Loading the tool...

All tools

JSON FormatterBeautify, validate and explore JSON with a tree view and exact error lines.Most usedJSON ValidatorCheck JSON syntax and see the exact line and reason for any error.ValidateJSON EditorEdit JSON with line numbers, live validation and a tree view.EditJSON ViewerBrowse JSON as a collapsible tree with search and copy-path.TreeJSON Pretty PrintPretty print JSON with 2, 3, 4 spaces or tabs.FormatJSON ParserParse JSON into a tree and pinpoint syntax errors.ParseJSON MinifyCompress JSON into a single compact line.CompressJSON ReaderOpen and read .json files as a searchable tree.ReadJSON StringifyConvert JSON to an escaped string literal, like JSON.stringify.EscapeJSON to One LineCollapse multi-line JSON into a single line.CompactJSON CompareCompare two JSON documents and list added, removed and changed values.DiffJSON SorterSort JSON keys alphabetically at every nesting level.SortJSON5 FormatterFormat JSON5 and convert it to standard JSON.JSON5JSON5 ValidatorValidate JSON5 syntax and locate errors.JSON5JSON to XMLConvert JSON to indented XML with a custom root element.ConvertJSON to CSVConvert a JSON array of objects to CSV with flattened columns.ConvertJSON to YAMLConvert JSON to clean, readable YAML.ConvertJSON to TSVConvert JSON to tab-separated values.ConvertJSON to StringConvert JSON into an escaped string for code and configs.ConvertString to JSONUnescape a JSON string and format it as readable JSON.ConvertJSON to ExcelConvert JSON to a downloadable Excel .xlsx file.ExcelJSON to HTML TableConvert a JSON array into an HTML table.ConvertJSON to Markdown TableConvert JSON into a neatly aligned Markdown table.ConvertXML to JSONConvert XML to JSON, keeping attributes and repeated elements.ConvertXML to CSVConvert repeating XML elements to CSV rows.ConvertXML to YAMLConvert XML to readable YAML.ConvertXML to StringConvert XML into an escaped single-line string.ConvertRSS to JSONConvert RSS and Atom feeds into JSON with a simple items array.FeedsYAML to JSONConvert YAML to JSON, including multi-document files.ConvertYAML to XMLConvert YAML to indented XML.ConvertYAML to CSVConvert a YAML list into CSV.ConvertCSV to JSONConvert CSV to a JSON array of objects.ConvertCSV to XMLConvert CSV to XML with one element per row.ConvertCSV to YAMLConvert CSV to a YAML list.ConvertCSV to HTML TableConvert CSV to an HTML table with preview.ConvertExcel to JSONConvert Excel .xlsx files to JSON, privately in your browser.ExcelExcel to HTML TableConvert an Excel sheet to an HTML table.ExcelXML FormatterBeautify XML and check that it is well formed.FormatXML MinifyCompress XML by removing whitespace and comments.CompressXML ViewerView XML as a collapsible, searchable tree.TreeXML Pretty PrintPretty print XML with custom indentation.FormatXML ValidatorCheck XML syntax and locate errors.ValidateXML EditorEdit XML with live validation and a tree view.EditXML ParserParse XML and inspect the resulting structure.ParseWSDL FormatterFormat and validate WSDL web service descriptions.WSDLSOAP FormatterFormat SOAP request and response XML.SOAPYAML ValidatorCheck YAML syntax and find indentation errors.ValidateYAML ViewerView YAML as a collapsible tree.TreeYAML FormatterFormat YAML and keep its comments.FormatYAML ParserParse YAML and inspect the resulting data.ParseHTML FormatterBeautify HTML with clean indentation.FormatHTML Pretty PrintPretty print HTML with custom indentation.FormatHTML ValidatorCheck HTML for unclosed tags, duplicate ids and missing alt text.ValidateHTML ViewerPreview HTML in a safe sandbox.PreviewHTML EditorEdit HTML with a live preview.EditHTML MinifyCompress HTML by removing whitespace and comments.CompressHTML EscapeEscape special characters for HTML.EscapeHTML UnescapeUnescape HTML text back to plain characters.UnescapeXML EscapeEscape special characters for XML.EscapeXML UnescapeUnescape XML text back to plain characters.UnescapeJavaScript EscapeEscape special characters for JavaScript.EscapeJavaScript UnescapeUnescape JavaScript text back to plain characters.UnescapeJava EscapeEscape special characters for Java.EscapeJava UnescapeUnescape Java text back to plain characters.Unescape.NET (C#) EscapeEscape special characters for .NET (C#).Escape.NET (C#) UnescapeUnescape .NET (C#) text back to plain characters.UnescapeJSON EscapeEscape special characters for JSON.EscapeJSON UnescapeUnescape JSON text back to plain characters.UnescapeCSV EscapeEscape special characters for CSV.EscapeCSV UnescapeUnescape CSV text back to plain characters.UnescapeSQL EscapeEscape special characters for SQL.EscapeSQL UnescapeUnescape SQL text back to plain characters.UnescapeString UtilityChange case, sort and clean lines, count characters and words.TextURL EncodePercent-encode text for URLs and query strings.EncodeURL DecodeDecode percent-encoded URLs and query strings.DecodeJSON URL EncodeURL-encode JSON for query parameters.EncodeJSON URL DecodeDecode URL-encoded JSON back to readable text.DecodeXML URL EncodeURL-encode XML for query parameters.EncodeXML URL DecodeDecode URL-encoded XML back to readable text.DecodeYAML URL EncodeURL-encode YAML for query parameters.EncodeYAML URL DecodeDecode URL-encoded YAML back to readable text.DecodeBase64 EncodeEncode text to Base64, standard or URL-safe.EncodeBase64 DecodeDecode Base64 strings, including URL-safe variants.DecodeJSON to Base64Encode JSON to Base64, with validation.EncodeBase64 to JSONDecode Base64 into formatted JSON.DecodeXML to Base64Encode XML to Base64, with validation.EncodeBase64 to XMLDecode Base64 into formatted XML.DecodeYAML to Base64Encode YAML to Base64, with validation.EncodeBase64 to YAMLDecode Base64 into formatted YAML.DecodeJS BeautifierTurn minified or messy JavaScript into readable, indented code.FormatJavaScript Pretty PrintPretty print JavaScript so you can read it.FormatCSS FormatterFormat CSS into clean rules, one declaration per line.FormatCSS Pretty PrintPretty print CSS so each rule and property is easy to read.FormatCSS MinifyRemove comments and whitespace to get the smallest CSS.CompressC# FormatterIndent C# code and put braces and statements on their own lines.FormatJava FormatterPut Java code back into a readable layout: one statement per line, braces indented.FormatGraphQL FormatterFormat GraphQL queries and schemas so nested selections are easy to read.FormatAngular FormatterFormat Angular component templates with their structural directives and bindings.FormatVue FormatterFormat a Vue single-file component: template, script and style together.FormatLess FormatterFormat Less code, with its variables, mixins and nested rules.FormatSCSS FormatterFormat SCSS, including nested rules, mixins, maps and @use statements.FormatTypeScript FormatterFormat TypeScript code, with generics, decorators, enums and type annotations.FormatBabel FormatterFormat modern JavaScript and React JSX with the Babel parser.FormatMarkdown FormatterTidy Markdown: consistent lists, aligned tables and normal spacing.FormatMDX FormatterFormat MDX, the mix of Markdown and JSX used by many documentation sites.FormatGlimmer FormatterFormat Glimmer and Handlebars templates, as used in Ember.js.FormatLWC FormatterFormat Lightning Web Component (LWC) HTML templates for Salesforce.FormatPHP FormatterFormat PHP code with consistent indentation and spacing.FormatFlow FormatterFormat JavaScript code that uses Flow type annotations.FormatJSON to JavaGenerate Java classes from JSON.JavaXML to JavaGenerate Java classes from XML.JavaJSON to PythonGenerate Python classes from JSON.PythonXML to PythonGenerate Python classes from XML.PythonJSON to Objective-CGenerate Objective-C classes from JSON.Objective-CXML to Objective-CGenerate Objective-C classes from XML.Objective-CJSON to JSON SchemaGenerate JSON Schema schema from JSON.JSON SchemaXML to JSON SchemaGenerate JSON Schema schema from XML.JSON SchemaJSON to SwiftGenerate Swift classes from JSON.SwiftXML to SwiftGenerate Swift classes from XML.SwiftJSON to C#Generate C# classes from JSON.C#XML to C#Generate C# classes from XML.C#JSON to GoGenerate Go classes from JSON.GoXML to GoGenerate Go classes from XML.GoJSON to RustGenerate Rust classes from JSON.RustXML to RustGenerate Rust classes from XML.RustJSON to CrystalGenerate Crystal classes from JSON.CrystalXML to CrystalGenerate Crystal classes from XML.CrystalJSON to C++Generate C++ classes from JSON.C++XML to C++Generate C++ classes from XML.C++JSON to TypeScriptGenerate TypeScript classes from JSON.TypeScriptXML to TypeScriptGenerate TypeScript classes from XML.TypeScriptJSON to JavaScript PropTypesGenerate JavaScript PropTypes classes from JSON.JavaScript PropTypesXML to JavaScript PropTypesGenerate JavaScript PropTypes classes from XML.JavaScript PropTypesJSON to FlowGenerate Flow classes from JSON.FlowXML to FlowGenerate Flow classes from XML.FlowJSON to KotlinGenerate Kotlin classes from JSON.KotlinXML to KotlinGenerate Kotlin classes from XML.KotlinJSON to ElmGenerate Elm classes from JSON.ElmXML to ElmGenerate Elm classes from XML.ElmJSON to RubyGenerate Ruby classes from JSON.RubyXML to RubyGenerate Ruby classes from XML.RubyJSON to DartGenerate Dart classes from JSON.DartXML to DartGenerate Dart classes from XML.DartJSON to PikeGenerate Pike classes from JSON.PikeXML to PikeGenerate Pike classes from XML.PikeJSON to HaskellGenerate Haskell classes from JSON.HaskellXML to HaskellGenerate Haskell classes from XML.Haskell

How to use JSON Formatter

  1. Paste your JSON into the left box, drop a file on it, or use Upload or From URL.
  2. Pick an indent size. Turn on key sorting if you want the keys in alphabetical order.
  3. The result appears on the right as you type. Switch to Tree view to fold and unfold nested objects.
  4. Use Copy or Download to take the result with you.

About JSON Formatter

Most JSON you meet in real life is not pretty. It comes out of an API as one long line, or from a log file with half the quotes escaped, or from a colleague who pasted it into chat. This formatter turns it into something you can actually read, and it tells you straight away if the JSON is not valid.

Everything happens in your browser tab. Your data is not sent to our server, which matters when the JSON contains customer records, tokens or anything else you would rather keep to yourself. Large numbers such as 12345678901234567890 are kept exactly as you typed them, so IDs do not get silently rounded the way they do in many other tools.

What the error messages tell you

When the JSON is invalid you get the line and column, the line itself with a caret under the problem, and a plain explanation such as "Trailing comma is not allowed in JSON". Click Go to error and the cursor jumps to the right spot.

The Fix JSON button handles the usual suspects: single quotes, unquoted keys, trailing commas and comments. Always read the result before you use it, because a repair tool has to guess what you meant.

Tree view and search

The tree view is handy when the document is big. Click a key to copy its path, for example $.items[0].sku. The search box looks through keys and values and opens the branches that match.

Frequently asked questions

Is my JSON uploaded anywhere?

No. Formatting and validation run in your browser with JavaScript. If you turn off your internet connection after the page has loaded, the tool still works. The only time a request leaves your browser is when you use From URL and the target site blocks direct access.

Why does my JSON fail when it looks fine?

The usual causes are a trailing comma after the last item, single quotes instead of double quotes, a missing comma between two properties, or a key without quotes. JavaScript objects allow all of those, JSON does not. The error message points at the line, and Fix JSON can repair most of them.

How big a file can I paste?

The limit on this site is set generously, and files of several megabytes work fine. Above about 1.5 MB the tool stops auto-formatting while you type and waits for you to press the button, so your browser stays responsive.

Does formatting change my data?

No. Only whitespace changes. Key order is kept unless you switch on sorting, and numbers are written back exactly as they were. Tabs and spaces are the only difference between the input and the output.

What is the difference between formatting and validating?

Validating checks that the text follows the JSON rules. Formatting rewrites the whitespace to make it readable. This tool does both at once: it can only format text it has first managed to parse, so a successful result also means your JSON is valid.

More in JSON Tools

All tools →