JSON validator

Try JSON Validator

JSON Validator inputs

Loading calculator. If this message stays visible, enable JavaScript and reload.

Use the JSON validator to check whether pasted text can be parsed as one JSON value. Supply the JSON in the input field and choose Calculate / Run. A successful check returns Valid JSON. If parsing fails, the result includes an invalid status and the browser parser's reason.

That answers a specific question about syntax. It does not confirm that an API accepts your fields, that a date is real, or that a record belongs to the right customer. Those checks need the receiving system's rules. This guide explains the difference, gives reproducible valid and invalid examples, and shows how to investigate errors without changing data merely to make a warning disappear.

Checking JSON syntax

What does a valid result actually establish?

The JSON validator checks whether the browser's JSON parser accepted the supplied text as a JSON value. The implementation calls that parser and reports whether it succeeded. It does not rewrite your payload or produce a corrected version. For a short API sample, this is a useful first check before investigating the request's application-specific behaviour.

JSON is a data format with a defined grammar. A value can be an object, array, string, number, boolean or null. An object often appears in examples because named fields are useful, but an object is not the only valid starting point. A standalone number or string can also be syntactically valid even when a particular API requires an object.

Keep that distinction in the wording of a bug report. “The payload parses as JSON” is a narrower statement than “the request is correct.” An endpoint might require a property named quantity, reject negative quantities or require a particular authentication method. This tool knows none of those business rules. It also does not contact the endpoint to see whether a request succeeds.

How do I run a useful validation check?

Copy the complete JSON body and replace the sample in the labelled JSON input area. Include the full value, not just a fragment selected from its middle. Choose Calculate / Run and read both the main status and any reason beneath it. If you edit the text, run the check again before recording a result.

Keep HTTP headers, console prefixes and Markdown fences out of the input. A response label followed by an object is not the same string as the object alone. If your application logs a prefix such as payload=, separate that diagnostic label from the data before checking the JSON. Retain a copy of the full log for context.

Use a sanitised example when a payload contains private information. Replace credentials or personal records in your own environment before pasting a sample into a general-purpose page. Make replacements carefully: replacing a number with an unquoted placeholder word would introduce a new syntax error. For a string placeholder, keep valid JSON quotation and escaping.

Record the exact tested version. A status copied from one payload cannot describe a later edited version. For shared debugging, keep the original sample and the proposed correction separately, then check each. This lets another person reproduce the failure rather than guessing which commas or quotes you changed.

Which ordinary JSON values pass the check?

The following inputs were checked with the MoneyOr implementation. They illustrate accepted syntax, not a universal data model for an application. An array can contain different value types, and a quoted numeric-looking value remains a string.

InputResultMeaning
{"ticket":"R42","open":true,"tags":["new","web"]}ValidAn object containing a string, boolean and array.
[1,"two",null,false]ValidAn array with several JSON value types.
nullValidA complete null value.
42ValidA standalone number.
"hello"ValidA standalone string.

Notice the quotes around "hello". The bare text hello is not a JSON string. Similarly, the boolean false and the string "false" are both valid values but do not mean the same thing. If a server rejects one, changing it to the other may affect behaviour rather than merely repair formatting.

Empty containers can be valid too. An empty object can represent the absence of named members, while an empty array represents a list with no entries. Whether either is allowed for a particular field depends on its contract. A valid syntax result is the start of that review, not permission to replace a required record with an empty container.

Which mistakes commonly make JSON invalid?

Names and string values need double quotes. Members and array entries need commas between them, but an extra final comma is not accepted. Literal booleans use lowercase spelling. Numbers have their own grammar, so a leading plus sign or an ordinary leading zero can cause a failure even if a spreadsheet would accept the entry.

Failing inputIssueA valid alternative
{'a':1}Single-quoted name{"a":1}
{"a":1,}Trailing comma{"a":1}
{"active":True}Uppercase boolean spelling{"active":true}
01Leading zero in a number1, or "01" if the contract requires a string
[1,2Unfinished array[1,2] when that completes the intended data

The alternatives demonstrate grammar, not decisions about your source data. The distinction matters for an identifier such as "01". Removing the zero from an identifier can change its meaning. If the original file is truncated or a field is missing, retrieve the complete record instead of inventing values to obtain a valid status.

Quotation marks copied from formatted prose can also be the wrong characters. JSON delimiters are the ordinary double-quote character, not typographic opening and closing quotation marks. Inspect a small example when a document looks correct but fails near its first property. Avoid replacing every quote in a large payload blindly; escaped quotation marks inside a string have a different role.

How do I read a parser reason or error position?

The reason is the browser parser's explanation of where it stopped. Exact wording varies between browser engines and versions. It may identify an unexpected character, a position or a line and column. Treat that location as a clue and inspect the nearby source, including the preceding property or string.

The first mistake can occur before the reported point. A missing closing quote may make a later comma appear to be part of a string. A missing comma can make the next property name seem unexpected. Start with the smallest surrounding object or array that preserves the problem, then compare its delimiters and separators with a known-valid example.

If the copied text starts with an HTML error page, the problem is probably earlier in the request workflow. A server may return a login page or an error response where you expected JSON. Changing angle brackets or deleting the first line is not a repair. Check the response status and content in the system that produced it, then supply the actual JSON body when available.

Make one deliberate correction at a time and run the validator again. Keep the original while you work. Once syntax passes, return to the application test rather than assuming the investigation is complete. A successful parse can reveal the next error, such as a missing field, which this tool is not designed to evaluate.

What does this JSON validator not check?

It does not apply JSON Schema. A schema can require an object, name mandatory properties, restrict types or constrain values. This form has no schema input. The JSON Schema project's Creating your first schema tutorial explains that separate layer. A payload can pass this syntax check and still fail its application's schema.

It also does not check dates, currency units, identifier existence or relationships between fields. The object {"enabled":"false"} passes because the value is a legal string. A program expecting a boolean may reject it or handle it differently. A date-like string is still just a string to this check.

Repeated object names are another limit. The input {"a":1,"a":2} receives a valid result from this parser. That does not establish that duplicate names are safe or interoperable. Inspect the original for repeated names when that risk matters. A formatter can collapse them while writing out a parsed object, so preserve the raw record during that investigation.

Number precision is outside the status too. Syntax acceptance does not prove that every numeric value can be represented exactly by the runtime or by another system. Very large exponents can also exceed a runtime's finite number range. Use the destination's type requirements and an exact-data workflow where necessary. This is a syntax result, not a numerical integrity report.

Where does validation fit into an API or configuration workflow?

Check the response or file you actually intend to use. First confirm that it is JSON rather than an HTML error or a log wrapper. Then test syntax here. After syntax passes, compare the structure and types with the endpoint's documentation or the configuration format's specification. Finally, run the appropriate application test in its intended environment.

For a compact but valid payload, the JSON formatter can make nested fields easier to inspect. Read its data-preservation limitations before rewriting a source. The JSON minifier serves a different task again: producing a compact representation after parsing.

Sometimes the JSON is inside a separate encoding. A documented Base64 envelope can require Base64 decoding; a URL component can require URL decoding. Decode only when the source format calls for it. Removing escape characters repeatedly until text looks familiar can damage a correct value. Validate the resulting complete JSON, not an assumed fragment.

Keep the test case small enough to discuss clearly. A minimal sample with a single failing member is easier to reproduce than a full production dump, and it avoids exposing unnecessary information. Include the expected field type and the actual parser result in your own issue notes.

How do result controls and local processing affect the workflow?

Copy result copies the displayed status and any reason, subject to the browser's clipboard permissions. It does not copy a repaired payload, because the validator has not created one. Download CSV records the output in a small report, useful for keeping a check result alongside your own sample file. A report is not a substitute for the tested input.

Save as baseline keeps a result for a later comparison on the current page. It does not archive the JSON body or preserve an editing history. Reset fields restores the initial form values and clears the displayed result. Keep your original and corrected samples in your own editor or project storage before resetting or leaving the page.

The parser operation runs in the browser and does not execute JavaScript contained in the JSON as a program. That does not make every payload safe for later use. A downstream application still needs appropriate validation and safe output handling. The website's broader delivery and data practices are described in the MoneyOr privacy policy. Never put production secrets into a public debugging example.

JSON validation questions

Can the validator fix errors automatically?

No. It reports whether parsing succeeded and shows a reason when it failed. Correct the source according to the intended data, then run another check. Automatic-looking fixes can be harmful when a leading zero, repeated member or missing fragment represents a real source problem. Keep the original so you can explain what changed.

Are comments accepted in configuration files?

Comments are not accepted by this JSON parser. Some configuration formats deliberately extend JSON or resemble it while allowing comments and other syntax. Use the specification of the actual format. A file that works in one application's extended configuration parser can still fail a strict JSON syntax check without either tool necessarily being broken.

Does a valid result verify UTF-8 file encoding?

No. This form receives text through a browser field, not the original sequence of bytes in an uploaded file. It checks the text that reached that field. If file encoding is part of your problem, inspect the original file with appropriate development tools and the receiving system's requirements. Pasting alone does not establish its original encoding.

Can several JSON objects appear on separate lines?

The form expects one complete value. Separate top-level objects on successive lines do not become one JSON document just because a newline separates them. JSON Lines and streaming formats need a process that understands their record boundaries. Converting records into an array may be suitable for a particular task, but it changes the surrounding format.

Why does an escaped newline pass while a literal one fails?

Within a JSON string, the escape sequence \n represents a newline value. An actual unescaped newline inside that quoted string is not accepted. Newlines placed between members are different: those are structural whitespace and can be valid. Inspect whether the line break is inside or outside the string's delimiters before editing it.

Can I validate a remote API just by pasting its URL?

This form does not fetch URLs or call APIs. Paste the response body itself after obtaining it through an appropriate authorised workflow. The URL parser can inspect components of an address, but it also does not confirm that a remote endpoint returns valid JSON. Request behaviour and payload syntax are separate checks.

Validation references

The examples were checked against MoneyOr's current parser-based implementation. Application acceptance requires its own contract and tests.