What does "Invalid JSON in tag 'schema'" mean in Shopify?
It means the JSON between {% schema %} and {% endschema %} in one section file has a syntax mistake, so Shopify refuses to save that file. The usual culprits are a missing comma, single quotes instead of double quotes, curly quotes pasted from a document or chat window, or an unescaped " inside a text value.
We reproduced the error on a Shopify development store on 17 October 2026 by uploading nine section files, each with a different JSON mistake. The messages and results below are copied from that store.
What does the full error look like?
Shopify names the file and nothing else:
sections/missing-comma.liquid
Invalid JSON in tag 'schema'There is no line number and no hint about which character is wrong. Every one of the six files Shopify refused in our test got exactly this message, whether the problem was a missing comma or a missing bracket. That is why this error feels harder than it is: the fix is usually one character, but Shopify does not tell you which one. The section below on finding the mistake covers two ways to get the exact spot.
Which mistakes cause it?
We uploaded nine versions of the same small section with Shopify CLI 3.93.1, each broken in one way. Six were refused. Three were accepted, which surprised us:
| Mistake in the schema | Example | Shopify's result |
|---|---|---|
| Missing comma between two entries | "name": "Hero" "settings": [] | Refused: Invalid JSON in tag 'schema' |
| Single quotes | {'name': 'Hero'} | Refused: Invalid JSON in tag 'schema' |
| Curly quotes (from Word, Google Docs, Notes or a chat window) | {“name”: “Hero”} | Refused: Invalid JSON in tag 'schema' |
| A double quote inside a text value | "default": "The "best" shop" | Refused: Invalid JSON in tag 'schema' |
| One closing brace too many | {"name": "Hero", "settings": []}} | Refused: Invalid JSON in tag 'schema' |
| A bracket never closed | "settings": [{ ... } with no ]} | Refused: Invalid JSON in tag 'schema' |
| Trailing comma after the last entry | [{ ... },] | Accepted. The section rendered with its default text |
A // comment line | // hero settings | Accepted |
A /* */ comment | /* hero settings */ | Accepted |
So Shopify's schema reader is more forgiving than strict JSON about trailing commas and comments, but not about quotes, commas between entries or brackets. We would still remove trailing commas and comments: Shopify does not document that it allows them, and any ordinary JSON checker you paste the schema into will flag them, which hides the real mistake in a list of false alarms.
How do I find the exact mistake?
Two ways, both free.
If you edit in the Shopify admin: copy everything between {% schema %} and {% endschema %} (not the tags themselves) and paste it into a JSON validator such as jsonlint.com, or into any code editor that understands JSON, like VS Code. It will point at the line and character where parsing stopped. The real mistake is usually on that line or the line just above it, because a missing comma is only noticed when the next entry starts.
If you use Shopify CLI: run shopify theme check in the theme folder. Unlike the upload message, it explains each problem under the ValidSchema check. These are the messages it gave for our broken files:
| theme check message | What it means | Fix |
|---|---|---|
Expected comma | Two entries sit next to each other with no comma between them | Add a comma after the earlier entry |
Property keys must be doublequoted | Single quotes or curly quotes around a name like name or settings | Retype every quote as a straight double quote " |
Property best is not allowed, Expected comma and Colon expected together | A " inside a text value ended the string early, so the rest of the sentence looks like new keys | Write the inner quote as \", or use a different character such as an apostrophe |
End of file expected | Something comes after the schema's final closing brace, usually an extra } | Delete the extra character |
Expected comma or closing bracket | A [ or { was opened and never closed | Add the missing ] or } where that list or object ends |
theme check reported each of these as an error with the line it applies to, and it raised nothing for the trailing comma or comment files, which matches what the upload accepted.
Why does one bad schema break my homepage?
Because the refused file is not saved, and whatever points at it then fails too. In our test, a homepage template that used the refused section was itself rejected with a second, unrelated looking message:
templates/index.json
Section type 'missing-comma' does not refer to an existing section fileIf you see both messages in one upload, fix the Invalid JSON one. The template error disappears with it. The same chain happens with other schema errors, which we list in why a Shopify theme ZIP will not upload.
Did my live store break when the save failed?
No, and this is the reassuring part. We uploaded a working version of a section, confirmed it on the storefront, then uploaded a broken version of the same file. Shopify refused the broken one and the storefront kept showing the working version. A failed save changes nothing; your store keeps running the last version Shopify accepted.
The risk is the opposite one: a brand new section that is refused simply does not exist, so if you were adding it to a page, it is missing rather than broken. And nothing about this touches your products, orders or customers, which live outside the theme (see will I lose my products if I change my Shopify theme).
How do I avoid it next time?
- Never write schema in a word processor or notes app. They turn straight quotes into curly ones as you type. Use the Shopify code editor or a code editor.
- Check code from a chat assistant or a forum before pasting. Copying from some chat windows and web pages brings curly quotes along. Search the pasted block for
“and”. - Avoid double quotes inside text. If a default needs one, write it as
\". An apostrophe needs no escaping in JSON. - Add new settings one at a time and save between them. When the error appears, you know which entry caused it.
- Run
shopify theme checkbefore uploading if you use the CLI. It catches every refused case above with a readable message.
Valid JSON is only the first check. A schema can parse perfectly and still be refused for what it says, such as a setting with an empty default; that is a different message, covered in what "default can't be blank" means. If you are new to how settings and blocks fit inside a schema, the difference between a section and a block explains the structure.
Where these results come from
On 17 October 2026 we built a minimal theme with one working section and nine copies of it, each with one JSON mistake from the table above. We pushed it to a Shopify development store as an unpublished theme with Shopify CLI 3.93.1, read the errors Shopify returned, fetched the storefront to see which sections rendered, ran shopify theme check on the same folder, then tested the template chain and a broken save over a working file. We did not test the admin code editor itself. The test theme was deleted afterwards. If you would rather start from schemas that already pass, every theme in our free theme gallery has been uploaded to Shopify without errors, and you can preview it before installing.
Frequently asked questions
What does "Invalid JSON in tag 'schema'" mean in Shopify?
The settings block between {% schema %} and {% endschema %} in a section file has a JSON syntax mistake, so Shopify refuses to save that file. The message names the file but not the line. Common causes are a missing comma, single or curly quotes, an unescaped double quote inside a value, or an unclosed bracket.
How do I find which line has the invalid JSON?
Copy the text between {% schema %} and {% endschema %} into a JSON validator such as jsonlint.com or a code editor like VS Code; it points at the line where parsing stopped. With Shopify CLI, shopify theme check reports a ValidSchema error with a specific message such as "Expected comma" and the line it applies to.
Does Shopify allow trailing commas or comments in a section schema?
In our 17 October 2026 test, yes: a trailing comma, a // comment and a /* */ comment were all accepted, and the section rendered normally. Shopify does not document this, and standard JSON tools flag them, so it is safer to remove them.
Why do curly quotes cause Invalid JSON in tag 'schema'?
JSON only accepts straight double quotes. Word processors, notes apps and some chat windows convert them to curly quotes, which Shopify refuses. shopify theme check reports them as "Property keys must be doublequoted". Retype each quote as a straight double quote.
Will "Invalid JSON in tag 'schema'" break my live Shopify store?
No. Shopify refuses the broken file and keeps the last version it accepted. In our test the storefront kept showing the working section after a broken version of the same file was uploaded. A brand new section that is refused is simply missing.
Why does my upload also say "does not refer to an existing section file"?
Because the section with invalid JSON was not saved, so any template that uses it points at a file that does not exist. Fix the Invalid JSON error first and the template error goes away with it.
How do I put a double quote inside a schema default?
Escape it with a backslash, as \", for example "default": "The \"best\" shop". An unescaped double quote ends the string early and Shopify refuses the file. Apostrophes need no escaping.
Generate a theme that looks like your brand
A complete Shopify 2.0 theme with conversion features built in, ready in minutes. No credit card required.
Generate my theme freeNo Shopify store yet? Start one here, then bring the theme. Themr may earn a commission if you start a paid plan; it does not change what you pay.