Schema Markup Generator
Generate JSON-LD structured data for FAQ, Article, Local Business and more — in the format search engines actually prefer.
JSON does not escape the one thing that ends a script tag
Structured data is delivered inside an HTML <script> element, and an HTML
parser looking for the end of that element stops at the first
</script> it sees — inside a string or not. It has no idea what
JSON is. Meanwhile JSON.stringify escapes quotes, backslashes and control
characters, but not < or /, because neither means anything in
JSON.
So a business name of Acme </script><img src=x onerror=alert(1)> produces a snippet with
2 closing tags in it. The script element ends at the first one, and
everything after it lands loose in the page:
<img src=x onerror=alert(1)>"
}
That is an image tag with an onerror handler sitting in the page body. Anyone who
pastes generator output into a site has pasted in whatever the person filling the form wanted
to run — and the form is often a content editor, or a customer, or an import.
The fix is one character class, and this page applies it
Replacing every < with its JSON escape \u003c closes it
completely. The output above now contains exactly 1 closing tag, the JSON
still parses, and — the part that makes this the right fix rather than stripping the
input — the parsed string round-trips to precisely what was typed.
That matters because \u003c is not a different character. It is the same
character spelled another way, so a firm genuinely called A < B Consulting keeps
its name intact instead of having it quietly mangled. Escaping is not censorship, and any
generator that solves this by deleting angle brackets has broken a legitimate input to fix an
illegitimate one.
Most generators do not do this. It is worth pasting any tool's output through a validator
before trusting it — and worth typing </script> into one of its boxes
to see what comes out.
An empty box is not the same as no box
Leaving a field blank emits the property with an empty string rather than leaving it out. An
Article with four blanks ships 4 properties set to "":
author.namedatePublishedimageurl
A validator reads a missing property as "not provided" and an empty one as "provided, and wrong" — the second earns a warning where the first earns nothing at all. If you are not filling a field, deleting the line is better than leaving it blank.
The FAQ form has the same asymmetry in a sharper form. Of 2 entries where one has no question and one has no answer, 1 survives: the blank question is dropped, and the blank answer is kept, empty text and all. Only the question is checked before an entry is included, so a half-filled row makes it into the markup while an equally half-filled row does not.
How to use
- Pick the schema type that matches your page.
- Fill in the fields.
- Paste the JSON-LD into your page head.
- Validate it and check it matches visible content.
Frequently asked questions
Why JSON-LD rather than microdata?
Because it sits in a single block rather than being woven through your markup, which makes it far easier to maintain and impossible to break by editing the HTML around it. Google states a preference for it, and it has become the default.
Does structured data improve rankings?
Not directly. It makes a page eligible for rich results — star ratings, FAQ dropdowns, recipe cards — which can substantially improve click-through rate. Eligibility is not a guarantee, and search engines choose when to show them.
Must the markup match what is on the page?
Yes, and this is enforced. Marking up content that a visitor cannot see is a documented violation and can result in a manual penalty removing rich results entirely. FAQ schema for questions that do not appear on the page is the most common version of this.
Why did my rich result disappear?
Search engines change which types they display, sometimes broadly. FAQ and How-to rich results were substantially reduced across the board in 2023, which removed them for sites that had done nothing wrong. Structured data is worth having and not worth depending on.
How do I check it is correct?
With the official validators — Google's Rich Results Test for eligibility and the Schema.org validator for correctness. They answer different questions, and a page can be valid schema while not qualifying for any rich result.
Which types are worth adding?
Whichever genuinely describe your page: Article for content, LocalBusiness with proper address and hours for a physical business, Product with real availability for commerce, Breadcrumb for navigation. Adding types that do not fit the page is noise at best.
🔒 This tool runs entirely in your browser. Nothing you enter is uploaded, logged, or stored.