JSON guide

JSON format error line 1 column 1

A JSON error at line 1 column 1 means the parser failed before it found a real JSON value.

Open JSON Validator View all tools

Why the first character fails

This error is common when the input is not JSON at all: an empty response, an HTML error page, a plain text message, a log prefix, or a file with a hidden byte order mark before the first bracket.

Example

Input

<!doctype html><html><title>404 Not Found</title>

Output

This is HTML, not JSON. Check the request URL, status code, and response body.

How to find the real input

  1. Look at the first few characters before sending the value to a JSON formatter.
  2. If the value came from an API, check the HTTP status code and content type.
  3. Remove log prefixes, timestamps, labels, and hidden BOM characters before validating.
  4. If the body is empty, handle the empty response in code instead of parsing it as JSON.

HTML instead of JSON

An HTML response often starts with a less-than sign. If the parser expected { or [ and found <, the failure appears right at the start.

That points away from JSON syntax and toward the request: wrong route, login page, redirect, 404 page, or server error. Inspect the raw response before editing the payload.

Empty and hidden input

An empty string is not valid JSON because there is no value to parse. APIs that return 204 No Content need a separate code path.

Hidden bytes can also trip the parser. If the text looks right but fails at the start, re-copy it as plain text or check for a byte order mark.

Common mistakes

  • Trying to format an HTML error page as JSON
  • Parsing an empty response body
  • Leaving a log prefix before the opening brace
  • Assuming every failed API request still returns JSON

Related problems

FAQ

What does line 1 column 1 mean?

The parser failed immediately at the beginning of the input, usually because the content was empty or not JSON.

Why did an API return HTML instead of JSON?

Common causes include a wrong URL, redirect, authentication page, server error, or missing API route.

Can valid JSON start with a less-than sign?

No. A less-than sign usually means the input is HTML or XML, not JSON.