Home › Developer Tools › JSON Validator

JSON Validator

Paste JSON and it is checked as you type. Errors are pinned to the exact line and column with a plain-English reason and a fix tip, and common mistakes such as trailing commas, single quotes and comments can be repaired in one click.

Last updated:

JSON input
Ln 1, Col 1
Advertisement
Advertisement

How to use the JSON Validator

  1. Paste or type your JSON in the editor, or upload a .json file. It is validated automatically.
  2. Read the result. A green bar means valid JSON. A red bar shows the line, column and reason, and the error line is highlighted.
  3. Follow the fix tip or press Auto-fix to repair common mistakes like trailing commas, single quotes and comments.
  4. Press Go to error to jump the cursor straight to the problem.
  5. Format or minify valid JSON, then copy or download it.

JSON error messages explained

MessageInvalidValid
Trailing comma[1, 2, 3,][1, 2, 3]
Strings must use double quotes{'id': 'a1'}{"id": "a1"}
Property names must be wrapped in double quotes{id: 7}{"id": 7}
Missing "," between properties{"a": 1 "b": 2}{"a": 1, "b": 2}
Comments are not allowed{"a": 1} // note{"a": 1}
Not valid JSON: use null / trueNone, True, undefined, NaNnull, true
Invalid escape sequence"C:\Temp""C:\\Temp"
Leading zeros are not allowed{"zip": 01234}{"zip": "01234"}
Unexpected end of input{"a": [1, 2}{"a": [1, 2]}

The JSON syntax rules in one minute

JSON (RFC 8259 / ECMA-404) has six value types: object {"key": value}, array [value, value], string in double quotes, number (decimal, optional minus, fraction and exponent, no leading zeros), and the literals true, false and null. Keys are always double-quoted strings. Items are separated by commas with no comma after the last one. Whitespace between tokens is ignored, but there are no comments.

Inside a string, a double quote, a backslash and control characters such as line breaks must be escaped: \", \\, \n, \t, or \u0041 for any character by its code.

Tips for finding the real mistake

  • A parser stops at the first problem, so the reported position is where it noticed the error. A missing comma or quote is often at the end of the previous line.
  • "Unexpected end of input" means a bracket or string was never closed. The message names the bracket and the line where it was opened.
  • Copying from documents and chat apps can turn straight quotes into curly “smart” quotes, which JSON does not accept.
  • Large integers such as IDs over 9,007,199,254,740,991 are valid JSON, but JavaScript reads them with rounding. Store them as strings if exact values matter.

Frequently asked questions

How do I know if my JSON is valid?

Paste it into the validator. Valid JSON shows a green "Valid JSON" bar with its size, number of keys and nesting depth. Invalid JSON shows a red bar with the line and column of the first error and the reason.

What are the most common JSON errors?

A trailing comma after the last item, single quotes instead of double quotes, property names without quotes, comments, a missing comma between items, and values from other languages such as True, None, undefined or NaN.

What does Auto-fix change?

It removes comments and trailing commas, converts single-quoted and curly-quoted strings to double quotes, quotes bare property names, adds missing commas between items on separate lines, turns True/False/None into true/false/null, replaces undefined and NaN with null and closes unclosed brackets. Review the result: it repairs syntax, it cannot guess missing data.

Are duplicate keys invalid JSON?

The JSON standard (RFC 8259) says names within an object SHOULD be unique but does not forbid duplicates, so they pass validation. Most parsers silently keep only the last value, which is why the validator shows a warning.

Why is the column number different from my editor?

The column counts characters from the start of the line, starting at 1, with a tab counted as one character. Editors that expand tabs to several spaces may show a larger column.

Is my JSON uploaded anywhere?

No. Validation, auto-fix and formatting all run in JavaScript in your browser. Your data never leaves your device.

Does it support JSON5 or JSON with comments?

The validator is strict and reports comments, single quotes and trailing commas as errors because standard JSON parsers reject them. Use Auto-fix to convert JSON5-style input into standard JSON.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

JSON FormatterBeautify, minify and validate JSON, with a collapsible tree view.JSON ViewerExplore JSON as a collapsible tree, search keys and values and copy any node's path.JSON MinifierMinify and validate JSON, sort keys and see exactly how many bytes you save.JSON Escape / UnescapeEscape text for a JSON string, unescape \n and \" back to text, or stringify a whole object.jq PlaygroundRun jq filters on JSON in your browser with live output, flags and an example library.JSON to Go StructTurn JSON into Go structs with inferred types, nested structs and json tags.JSON to Java ClassTurn JSON into Java POJOs or records with Lombok, getters/setters and Jackson or Gson annotations.WebSocket TesterConnect to a ws:// or wss:// server, send messages and watch a timestamped live log.JSON to Excel ConverterTurn JSON into a styled .xlsx spreadsheet; nested arrays become their own linked sheets.JSON to CSVConvert JSON data to CSV for spreadsheets.CSV to JSONConvert CSV data to JSON with live preview.Excel to CSVConvert XLSX spreadsheets to CSV.CSV ViewerOpen a CSV or TSV file as a sortable, filterable table.Excel Viewer (XLSX / XLS)Open XLSX, XLS and ODS spreadsheets in your browser without Excel.Line Ending ConverterConvert text and files between CRLF, LF and CR line endings.Markdown to HTMLConvert Markdown to clean HTML with a live editor.XML to JSONConvert XML to JSON with validation.Text Encoding ConverterDetect and convert text file encodings like UTF-8, UTF-16 and Latin-1.TTF to WOFF2 ConverterConvert TTF and OTF fonts to WOFF2 or WOFF and get a ready @font-face CSS snippet.Chmod CalculatorConvert Linux file permissions between checkboxes, octal (755) and symbolic (rwxr-xr-x) notation.JSON to TypeScriptGenerate TypeScript interfaces or types from JSON, with nested types and optional fields.Morse Code TranslatorTranslate text to Morse code and back, then play it as sound or a blinking light, or save a WAV.HTML Table GeneratorBuild HTML tables in an editable grid with styles, header rows, CSV import and live preview.Hex to Text ConverterConvert hex to text and text to hex with UTF-8 support and space, 0x, \x or comma formats.JSON to XML ConverterConvert JSON to well-formed XML with attributes, arrays and pretty print.JSON to YAML ConverterConvert JSON to clean YAML as you type, with indent, quoting and sort options.YAML to JSON ConverterConvert YAML to pretty or minified JSON, with errors pinned to the exact line.HTML to Markdown ConverterTurn HTML or pasted rich text into clean Markdown with tables and live preview.Markdown Table GeneratorBuild Markdown tables in a grid or paste from Excel/CSV, with alignment and preview.Image to Base64Convert images to Base64 data URIs, CSS backgrounds and HTML img tags in your browser.Base64 to ImagePaste a Base64 string or data URI to preview, identify and download the image.JSON CompareCompare two JSON documents and see every added, removed and changed path.Hex to DecimalConvert hex to decimal instantly with steps and signed mode.Decimal to HexConvert decimal to hex instantly with steps and signed mode.Binary to DecimalConvert binary to decimal instantly with steps and signed mode.Decimal to BinaryConvert decimal to binary instantly with steps and signed mode.Two's Complement CalculatorDecimal to two's complement binary and back for 4-64 bits, with invert-and-add-1 steps.XML to CSV ConverterConvert XML to CSV: detects repeating records, flattens nested data, pick your columns.XML ValidatorCheck if XML is well-formed, see the exact line and column of each error and pretty-print it.Wildcard Mask CalculatorConvert a subnet mask or CIDR to a wildcard mask for ACLs and OSPF, with range and binary.CSV to VCF ConverterConvert a contacts CSV into a vCard (.vcf) file, mapping columns to name, phone, email and more.CSV to YAML ConverterConvert CSV rows to a YAML list of mappings with type inference and delimiter detection.Endianness ConverterSwap byte order of 16, 32 and 64-bit hex values and see big- and little-endian integers and floats.Excel to SQL ConverterTurn an Excel sheet into CREATE TABLE and INSERT statements for MySQL, PostgreSQL, SQLite or SQL Server.Excel to VCF ConverterTurn an Excel contact list into a vCard .vcf file for iPhone, Android, Google or Outlook.File to C ArrayConvert any file into a C or C++ byte array header, like xxd -i, with const and PROGMEM options.Image to C ArrayConvert images to monochrome, RGB565 or RGB888 C arrays for OLED, LCD and TFT displays.JSON Merge ToolDeep-merge two or more JSON objects with array concat, replace or union and a conflict rule.JSONL to CSV ConverterConvert JSON Lines / NDJSON to CSV with flattened columns; streams large files locally.PHP Unserialize OnlineDecode PHP serialize() strings to JSON, a tree or print_r, and serialize JSON back to PHP.SQL Dialect ConverterTranslate SQL between MySQL, PostgreSQL, SQLite, SQL Server, Oracle, BigQuery and more.TSV to JSON ConverterTurn tab-separated data pasted from Excel or Sheets into a JSON array or keyed object.XLS to XLSX ConverterConvert old Excel 97-2003 .xls workbooks to modern .xlsx files in your browser, several at once.XML to Excel ConverterTurn repeating XML elements into an .xlsx spreadsheet with attributes and nested data as columns.XSD to XML Sample GeneratorGenerate a sample XML document from an XSD schema, with types, attributes and namespaces.YAML to CSV ConverterTurn a YAML list of objects into CSV with dot-notation columns, custom column order and download.DOCX to Markdown ConverterConvert Word .docx to clean Markdown with headings, lists, tables, links and images in a ZIP.ES6 to ES5 ConverterTranspile modern JavaScript (ES2015+) to ES5 with Babel: targets, module format and loose mode.JavaScript Object to JSONTurn JS object literals and Python dicts into valid JSON: quotes keys, fixes commas and values.JSON Graph VisualizerSee JSON as an interactive node graph with zoom, collapse and search; export PNG or SVG.KML ViewerOpen KML and KMZ files on an interactive map: placemarks, paths, polygons, folders, export.MySQL to PostgreSQL ConverterConvert MySQL dumps and CREATE TABLE statements to PostgreSQL: types, AUTO_INCREMENT, ENUMs, quotes.Text to CSV ConverterTurn space-aligned, fixed-width, pipe or tab separated text into clean CSV with a live preview.VCF File ViewerOpen vCard .vcf files as contact cards with photos, search and duplicate check, export CSV.XML ViewerBrowse XML as a collapsible tree with search, XPath of any node, attributes and big-file support.CSV to XML ConverterConvert CSV to well-formed XML with custom root and row names, escaping and pretty print.TOML to JSON ConverterConvert TOML to JSON and JSON to TOML with a full v1.0 parser and clear error lines.JSON to Python ClassGenerate Python dataclasses, Pydantic models or TypedDicts with type hints from JSON.
See all 129 Data & File Format Converters →