Code Beautifier
Reference

The developer error reference

168 parser and validation errors developers actually hit, each with the exact fix. Every entry comes from a working tool on this site, so you can paste the offending input straight into it.

JSON & Data Interchange

84 errors across 21 tools · browse JSON & Data tools

JSON Formatter4

Unexpected token } in JSON

Remove a trailing comma before the closing brace, or add the missing property that should come before it.

Full explanation and a live example

Unexpected end of JSON input

Your payload is truncated — check for an unclosed string, array, or object.

Full explanation and a live example

Unexpected non-whitespace character after JSON

Paste a single JSON value. Extra text after the root object/array is invalid.

Full explanation and a live example

Expected property name or '}' in JSON

Object keys must be double-quoted strings. Single quotes are not valid JSON.

Full explanation and a live example

JSON Validator4

Unexpected token }

Remove a trailing comma before the closing brace.

Unexpected end of JSON input

Close open strings, arrays, or objects; the payload is truncated.

Expected property name

JSON keys must use double quotes, not single quotes.

Unexpected non-whitespace character

Paste a single JSON value with no trailing commentary.

JSON to CSV4

Input must be a JSON array

Wrap objects in [{...}] or enable flattening for nested records.

Unexpected token

Fix JSON syntax first with the JSON Formatter, then convert.

Empty array

Provide at least one object so column headers can be inferred.

Nested object not flattened

Enable Flatten nested objects to expand address.city-style columns.

JSON to TypeScript4

Unexpected token

Input must be valid JSON. Format and fix syntax errors first.

Cannot infer interface from primitive

Paste an object or array of objects, not a bare string or number.

Mixed array types

Heterogeneous arrays become unions; normalize samples for cleaner interfaces.

Empty object

Provide sample fields so property types can be inferred.

JSON Schema Validator4

schema is invalid

Fix the schema document first; Ajv cannot validate data against a broken schema.

must be object

Root schema type may require an object. Wrap arrays or primitives if your schema expects them.

must have required property

Add missing required fields or remove them from the schema required array.

Full explanation and a live example

must match format

Format keywords like email/uri need matching strings; disable format checking only if intentional.

Full explanation and a live example

CSV to JSON4

Too few fields

A row has fewer columns than the header. Pad empty cells or fix the delimiter.

Unescaped quote

Wrap fields containing commas in double quotes and escape quotes by doubling them.

Unable to auto-detect delimiter

Pick Comma, Tab, Semicolon, or Pipe explicitly in Options.

No rows parsed

Ensure the paste includes a header row or disable “First row is header” for raw matrices.

XML Formatter4

Unclosed tag

Every opening tag needs a matching close tag (or self-closing form). Check the reported line/column for the mismatch.

Full explanation and a live example

Mismatched closing tag

Closing tags must mirror the most recent open tag. Nested elements must close in reverse order.

Full explanation and a live example

Invalid character in attribute value

Quote attributes and escape & < > inside text. Prefer CDATA for large raw blocks.

XML declaration after content

Move <?xml ...?> to the very start of the document with no bytes before it.

Full explanation and a live example

YAML to JSON4

bad indentation of a mapping entry

Align nested keys under their parent with consistent spaces (never mix tabs). Every child must be indented further than its parent.

unexpected end of the stream within a flow collection

Close all [ ] or { } flow collections. A truncated paste often leaves an unclosed bracket.

Full explanation and a live example

duplicated mapping key

YAML object keys must be unique at each level. Rename or merge the duplicate key.

JSON parse failed in reverse mode

When converting JSON → YAML, paste a single valid JSON value. Trailing commas and single-quoted keys are invalid JSON.

OpenAPI Formatter & Validator4

Missing OpenAPI or Swagger version

Start with openapi: 3.x.x or swagger: "2.0" at the document root.

Missing info.title or info.version

Add info.title and info.version — both are required for a valid specification.

No paths defined

Include at least one entry under paths (for example /health with an operation).

YAML/JSON parse failure

Fix indentation or trailing commas before validation. Use the YAML→JSON companion for intermediate debugging.

Markdown Table Generator4

No rows detected

Paste CSV/TSV/JSON with at least a header and one data row.

Uneven columns

Pad missing cells so every row matches the header width.

Invalid JSON array

When using JSON mode, provide an array of objects with consistent keys.

Empty header

Provide column names; GFM tables require a header row and divider.

JSON to YAML4

Expected double-quoted property name in JSON

Remove the trailing comma before a closing brace, or put double quotes around the key.

Full explanation and a live example

Expected ',' or '}' after property value in JSON

Add the missing comma between two properties. The error points at the start of the second one.

Full explanation and a live example

Unexpected non-whitespace character after JSON

Two JSON documents were pasted back to back. Wrap them in [ ] and turn on 'Array → separate documents'.

A value changed type after conversion

Unquoted 22:22, yes, no, on, or 0123 are retyped by YAML 1.1 parsers. Keep the quotes this converter adds instead of removing them by hand.

JSON Diff4

Add a === MODIFIED === line between the two JSON documents

Put === ORIGINAL === above the first document and === MODIFIED === above the second, each on its own line.

Modified JSON: Trailing comma before a closing bracket.

Fix the syntax in the document named in the message. Line numbers count from the top of the whole input, markers included.

Every array item shows as changed

An item was inserted or removed near the start of the array, and arrays compare by index. Sort both arrays by a stable field first.

Large IDs show as equal when they differ

JSON numbers beyond 2^53 lose precision in JavaScript. Store IDs such as 9007199254740993 as strings.

JSON Repair4

Colon expected

The input isn't JSON. It's often a GraphQL query or JavaScript code; use the GraphQL Formatter or JavaScript Beautifier instead.

No JSON object or array found

The input is plain text or a single value. Paste the broken JSON, including its opening { or [.

Repaired output is missing data at the end

The source was truncated, so there was nothing to recover after the cut. Copy or request the complete payload.

Duplicate keys keep only the last value

JSON parsers keep the last occurrence of a repeated key. Rename duplicates before repairing if both values matter.

YAML Validator4

bad indentation of a mapping entry

Align sibling keys with the same number of spaces, and indent children further than their parent.

Full explanation and a live example

duplicated mapping key

A key appears twice in the same mapping. Rename one, or merge their values.

Full explanation and a live example

end of the stream or a document separator is expected

Content starts where a new key was expected, often a value that continues on an unindented line. Indent it or quote the value.

Full explanation and a live example

tab characters must not be used in indentation

Replace tabs with spaces. Most editors can convert indentation to spaces automatically.

Full explanation and a live example

JSON to Zod4

Expected number, received string

Zod 3's message when an API sends "42" where the sample had 42. Use z.coerce.number() if strings are expected, or fix the producer.

Full explanation and a live example

Invalid input: expected number, received string

The same type mismatch in Zod 4's wording. The issue's path points at the field to check.

Required

Zod 3's message for a missing key. If the field is legitimately absent sometimes, add a sample without it so it's generated as .optional().

Unrecognized key(s) in object

Strict objects reject keys the sample didn't include. Turn off Strict objects, or add the key to the schema.

Full explanation and a live example

JSON to Go4

json: cannot unmarshal string into Go struct field

The payload has a string where the struct expects a number, or the reverse. Generate from a sample with the real types, or use json.Number for numbers that arrive as strings.

Full explanation and a live example

json: cannot unmarshal number 18.25 into Go struct field Order.total of type int64

Real data has a fractional value the sample didn't. Add a fractional sample so the field is generated as float64.

Full explanation and a live example

json: cannot unmarshal array into Go value of type main.Root

The JSON root is an array. Decode into the generated slice type, such as RootList, instead of Root.

json: unknown field

Decoder.DisallowUnknownFields rejects keys the struct doesn't declare. Add the field, or generate from a more complete sample.

Full explanation and a live example

JSON to Python (Pydantic)4

Input should be a valid integer

Pydantic v2's error when a value like "abc" or 18.25 reaches an int field. Generate from a sample with the real type, or change the annotation to float or str.

Full explanation and a live example

Field required

A key is missing from the data. Include a sample without it so the field is generated as Optional[...] = None.

Full explanation and a live example

TypeError: non-default argument follows default argument

A dataclass field without a default comes after one with a default. Keep required fields first, as the generator writes them.

Field name "json" shadows an attribute in parent "BaseModel"

Keys like json or schema clash with BaseModel methods. The generator renames them with a trailing underscore and keeps the key as an alias.

JSON to Java4

UnrecognizedPropertyException: Unrecognized field

Jackson found a key the class doesn't declare. Add the field, generate from a fuller sample, or annotate the class with @JsonIgnoreProperties(ignoreUnknown = true).

Full explanation and a live example

InvalidFormatException: Cannot deserialize value of type `long` from String

The payload sends a number as a string. Change the field to String, or enable coercion on the ObjectMapper.

Cannot map `null` into type `long`

A primitive field received null while FAIL_ON_NULL_FOR_PRIMITIVES is on. Use the boxed type Long, which the generator picks for nullable samples.

Full explanation and a live example

Expected BEGIN_OBJECT but was BEGIN_ARRAY

Gson's error when the JSON root is an array. Deserialize into List<Root> with a TypeToken.

JSON to C#4

The JSON value could not be converted to System.Int32

System.Text.Json found a string or a decimal where an int is declared. The generator uses long and double; if you changed a type, match the payload or set JsonNumberHandling.

Full explanation and a live example

JSON deserialization for type 'Root' was missing required properties

A required property's key is absent from the JSON. Include a sample without that key so the property is generated as nullable, or make sure the producer sends it.

CS8618: Non-nullable property must contain a non-null value when exiting constructor

Nullable reference types are enabled and a property may never be set. Mark it required, as the generator does, or make it nullable.

Full explanation and a live example

CS0542: member names cannot be the same as their enclosing type

A JSON key matches the class name. The generator renames the member with a Value suffix and maps it back with the attribute.

JSON to Rust4

missing field `email`

The key isn't in the data. Add a sample without it so the field becomes Option<T>, or annotate the field with #[serde(default)].

Full explanation and a live example

invalid type: string "42", expected i64

The payload sends a number as a string. Change the field to String, or deserialize it with a helper such as serde_with's DisplayFromStr.

Full explanation and a live example

invalid type: floating point `18.25`, expected i64

Real data has a fractional value the sample didn't. Include a fractional sample so the field is generated as f64.

invalid type: sequence, expected struct Root

The JSON root is an array. Deserialize into the generated Vec type, such as RootList, instead of Root.

JSON to Kotlin4

MissingFieldException: Field 'email' is required for type with serial name 'Root', but it was missing

The key isn't in the data. Include a sample without it so the property is generated as nullable with a null default.

Full explanation and a live example

Unexpected JSON token at offset: Encountered an unknown key

kotlinx.serialization rejects keys the class doesn't declare. Add the property, or decode with Json { ignoreUnknownKeys = true }.

Serializer for class 'Root' is not found

The class isn't marked @Serializable, or the kotlinx.serialization compiler plugin isn't applied in the Gradle build.

Required value 'email' missing at $

Moshi's error for a missing non-null property. Make the property nullable with a null default, as the generator does for optional samples.

SQL & Databases

8 errors across 2 tools · browse SQL & Databases tools

SQL Formatter4

syntax error at or near ","

Remove a trailing comma in the SELECT list or VALUES clause.

Full explanation and a live example

Unclosed quotation mark

Balance single quotes around string literals; escape quotes by doubling them in SQL.

Full explanation and a live example

Incorrect syntax near ")"

Check for an extra closing parenthesis or a missing expression before it.

Full explanation and a live example

Invalid column name

Verify identifiers and aliases; dialect options change how identifiers are quoted.

CSV to SQL4

ERROR: column "order" does not exist

A column name is a reserved word. The generated SQL quotes every identifier for the chosen dialect, so run the output for the database you selected rather than mixing dialects.

ERROR: invalid input syntax for type bigint

A value doesn't match the inferred type, usually because the sample rows were all numeric and the real data isn't. Convert the full file so the column widens to text.

Full explanation and a live example

Quoted field not terminated

A quoted CSV field is missing its closing quote, or a literal quote inside it wasn't doubled. RFC 4180 requires "" for a quote inside a quoted field.

Data truncated for column at row 1

MySQL is rejecting a value longer than the column allows. Widen the column, or change the generated TEXT type to the size your schema expects.

Security & Auth

21 errors across 5 tools · browse Security & Auth tools

JWT Decoder4

Invalid token: expected 3 parts

A JWT must have header.payload.signature separated by dots. Paste the full token.

Full explanation and a live example

Failed to decode Base64URL segment

The token is truncated or corrupted. Copy it again without line breaks or spaces.

Full explanation and a live example

Payload is not valid JSON

The middle segment must decode to JSON claims. This tool does not verify signatures.

Token appears expired

The exp claim is in the past. Decoding still works; treat the session as expired.

Full explanation and a live example

JWT Generator4

Invalid JSON payload

Header and payload must be valid JSON objects before signing.

Secret required

Provide an HMAC secret for HS256/384/512 generation.

Unsupported algorithm

Use HS256, HS384, or HS512 with the Web Crypto path in this tool.

exp must be a number

Use a Unix timestamp (seconds) for the exp claim.

JWE Decoder5

Decryption failed: the key does not match this token, or the token was altered after it was issued.

Check the token's kid against your key set and confirm the key comes from the same environment as the token. Re-copy the token in full: one changed character fails authentication.

This JWK is a public key: it has no d member.

Decryption needs the recipient's private key. Export the private JWK (it includes d) from your key store; the public key can only encrypt.

This is a SEC1 "EC PRIVATE KEY", which browsers cannot import.

Convert the key to PKCS #8 with: openssl pkcs8 -topk8 -nocrypt -in key.pem -out key-pkcs8.pem, then paste the BEGIN PRIVATE KEY block.

Invalid JWE compact serialization: found 3 dot-separated parts, expected 5 (header.encrypted_key.iv.ciphertext.tag).

Three parts is a signed JWT, not a JWE. Open it in the JWT Decoder. A JWE always has five parts, and the encrypted key may be empty, leaving two dots in a row.

A256GCM requires a 12-byte IV, but this one is 16 bytes.

The issuer generated the wrong IV size for AES-GCM. Generate 96 random bits (12 bytes) per token; 16-byte IVs belong to the AES-CBC-HMAC enc values.

HTTP Headers & Security Inspector4

No headers detected

Paste raw response headers from DevTools (one Name: value per line). Include the status line if available.

Low security grade

Add HSTS, CSP, X-Frame-Options (or frame-ancestors), X-Content-Type-Options: nosniff, and a strict Referrer-Policy.

CORS credentials with wildcard

Browsers reject Access-Control-Allow-Origin: * with credentials. Echo a specific origin instead.

Full explanation and a live example

HSTS ignored on HTTP

Strict-Transport-Security only applies over HTTPS. Serve the site on TLS before enabling preload.

Password Generator4

Password must include a special character

Turn on Include symbols. If the site rejects a specific symbol, generate again; the pool is shuffled each time.

Password is too long for this site

Lower Length to 16 or 20. Some sites silently truncate long passwords, which breaks the next login.

Spaces are not allowed in passwords

Choose the hyphen, period, or underscore separator for passphrases instead of a space.

The generated password wasn't saved

Nothing is stored here. Paste it into your password manager first, since reloading the page generates a different one.

DevOps & Configuration

8 errors across 2 tools · browse DevOps & Config tools

cURL to Code4

Unable to parse curl command

Start with curl and include a URL. Multi-line shells should keep backslash continuations intact.

Missing URL

Provide an absolute http(s) URL after curl or via -X with a location.

Unsupported option ignored

Some curl flags have no fetch equivalent; core method, headers, and body still convert.

Invalid header line

Use -H "Name: value" with a colon separating name and value.

Docker Run to Compose4

services.web.ports contains an invalid type, it should be a string

An unquoted port mapping such as 22:22 was read as a number. Keep the quotes this converter adds around every port.

Full explanation and a live example

services.web.environment.DEBUG must be a string

Compose rejects bare booleans and numbers in environment. Keep values quoted, as the generated file does.

docker: invalid reference format

The command isn't a valid docker run: usually the image name is missing or a flag swallowed it. Check that the image comes after all flags.

Full explanation and a live example

The --rm flag was dropped

Compose has no per-service equivalent. Use docker compose run --rm service for one-off containers that clean up after themselves.

Web & Markup

23 errors across 5 tools · browse Web & Markup tools

HTML Formatter4

Unclosed tag warning

Close void-safe tags properly. Prefer self-closing only where HTML allows (img, br, meta).

Attributes not wrapping

Lower Wrap line length so long class or data attributes break onto new lines.

Script/style content shifted

Embedded blocks indent with parent depth; preserve intentional template whitespace carefully.

Empty lines removed

Enable Preserve empty lines to keep section spacing between major layout blocks.

CSS Minifier4

Unexpected }

Remove an extra closing brace or restore a missing selector block.

Unclosed comment

Close CSS comments with */; unterminated comments swallow following rules.

Invalid property value

Check units and function parentheses (rgb(), calc(), url()).

Empty stylesheet

Paste CSS rules before minifying; blank input produces empty output.

JavaScript Beautifier4

Unexpected token

Check for missing commas, unclosed brackets, or truncated minified bundles before beautifying.

Unterminated string constant

Restore matching quotes. Escaped quotes inside strings must use \" or template literals.

Beautify produced little change

Confirm Mode is Beautify, not Minify. Increase indent size if output still looks dense.

JSX / TS syntax looks odd

Most ESNext and TS syntax is supported; exotic Babel plugins may need a dedicated formatter.

HTML to JSX4

Adjacent JSX elements must be wrapped in an enclosing tag

The snippet has more than one root element. This converter adds a fragment automatically; keep it, or wrap the markup in a container element.

Full explanation and a live example

Warning: Invalid DOM property `class`. Did you mean `className`?

Raw HTML attributes were pasted straight into a component. Convert the markup first so class, for, and tabindex are renamed.

Full explanation and a live example

The `style` prop expects a mapping from style properties to values

A style attribute is still a string. Converted markup writes it as an object, so replace style="..." with the generated style={{ ... }}.

Expected corresponding JSX closing tag

An element in the source was never closed. The converter closes them, so re-convert the original HTML rather than hand-editing the JSX.

iframe Render Tester7

Blocked script execution in 'about:srcdoc'

The frame's sandbox has no allow-scripts token. Turn on sandbox: allow-scripts, or leave it off deliberately to check the layout without JavaScript.

Blocked form submission to '' because the form's frame is sandboxed

Turn on sandbox: allow-forms. Without it a submit is refused, which looks like a dead button.

Ignored call to 'alert()'. The document is sandboxed

Turn on sandbox: allow-modals, or replace the dialog with something you can see in the render, such as writing to an element.

Uncaught SecurityError: Failed to read the 'localStorage' property from 'Window'

Storage needs an origin, and a sandboxed frame has none. Turn on allow-same-origin; on your own page combine it with allow-scripts only for markup you trust, because together they are no sandbox at all.

Framing 'https://example.com/' violates the following Content Security Policy directive: "frame-ancestors *"

The framed page names the origins allowed to embed it, and a sandboxed frame without allow-same-origin has no origin for the policy to match; even * matches real http(s) origins only. Turn on sandbox: allow-same-origin: the frame then has an origin and the page loads, with its scripts too when allow-scripts is on. The copied snippet needs the same tokens wherever it is pasted. If the page is yours, send no frame-ancestors instead of *: it allows everyone anyway, and without it sandboxed embeds load too.

Refused to display 'https://example.com' in a frame

That page's X-Frame-Options or CSP frame-ancestors header forbids framing, and no attribute on your side overrides it. Only the site's own server can allow it.

Blank preview after pasting a full page

A document with its own <!doctype html> is used as-is rather than wrapped, so a missing <body> or an unclosed <head> tag renders as nothing. Run it through the HTML Formatter to find the unbalanced tag.

Encoding, Regex & Text

24 errors across 6 tools · browse Encoding & Text tools

Base64 Encode & Decode4

Invalid Base64 character

Remove whitespace or URL-encoding artifacts, or switch to URL-safe mode if your alphabet uses - and _.

Full explanation and a live example

Incorrect padding

Base64 length should be a multiple of 4. Add = padding or enable automatic padding repair if available.

Full explanation and a live example

Decoded text is garbled

The payload may be binary. Try viewing as a data URL via the Base64 Image converter.

URI malformed

When decoding to UTF-8 text, ensure the bytes form valid Unicode.

Full explanation and a live example

Regex Tester4

Invalid regular expression

Check for unescaped special characters or unbalanced parentheses/brackets in the pattern.

Full explanation and a live example

Nothing matches

Confirm flags (especially m and s) and whether you need ^/$ anchors.

Catastrophic backtracking

Simplify nested quantifiers like (a+)+ on long inputs to avoid locking the tab.

Full explanation and a live example

Unicode property escapes failed

Use a modern browser; \p{…} requires Unicode-aware RegExp support.

Diff Checker4

Both sides are empty

Paste original text on the left and modified text on the right before comparing.

Diff looks noisy

Try word- or line-level mode depending on whether you care about whitespace or structure.

Huge files freeze the tab

Prefer smaller excerpts for interactive diffs; multi-megabyte comparisons belong in a local git diff.

Line endings differ

Normalize CRLF vs LF offline if the only changes are carriage returns.

QR Code Generator4

Empty input

Enter a URL or text string to encode before generating.

Input too long for selected ECC

Raise error correction or shorten the payload; dense QR codes need more modules.

Unsupported character set

Stick to UTF-8 text or URLs; binary blobs belong in specialized encoders.

SVG render failed

Retry with Medium error correction; extremely long Wi-Fi strings may need splitting.

Case Converter4

Acronyms come out as Xml instead of XML

Casing lowercases the rest of each word by design. Fix those names by hand, or use the JSON to Go generator, which keeps Go initialisms capitalized.

Accented letters disappear in a slug

Slugs keep ASCII letters and digits only, so é becomes e and other scripts are dropped. Use kebab-case to keep the original letters.

Digits stay attached to the previous word

version2Beta splits at the capital B, but user2fa has no boundary to split on. Add a separator, such as user_2fa, before converting.

Leading or trailing separators disappear

Separators are treated as word boundaries, so _private becomes private. Add the prefix back after converting.

Sort & Remove Duplicate Lines4

The output lost my blank lines

Remove empty lines is on by default. Turn it off to keep them, though sorting will group them together.

Duplicates weren't removed

The lines differ invisibly, usually by trailing whitespace or capitalization. Turn on Trim whitespace, and leave Case sensitive off.

Line endings changed after sorting

The output uses the endings the input had, and a file with mixed endings is normalized to CRLF if any CRLF is present. Normalize the file first if that matters.

Version numbers sort in the wrong order

Alphabetical order puts 1.10 before 1.9. Choose natural order, which compares the numbers by value.