What is JSON-LD, and how do you write it for a local business?
By Bhavesh Barot
- Updated
- Reading time
- 9 min read
- Guide number
- No. 017

On this page
- 01Why JSON-LD instead of other formats?
- 02What goes in a LocalBusiness JSON-LD block?
- 03How do the nested parts work?
- 04What about the @id field?
- 05How do you mark up a service page?
- 06Where do you put the JSON-LD block?
- 07How do you test JSON-LD?
- 08What mistakes stop JSON-LD from working?
- 09Does JSON-LD help with AI answers?
- 10A checklist before you publish
- 11How does Seen in Search fit in?
- 12Questions developers and owners ask about JSON-LD
JSON-LD (JavaScript Object Notation for Linked Data) is a format for writing structured data: a block of labeled facts about a page that search engines and other software can read. It's the format Google recommends for schema markup. On a local business site, a JSON-LD block typically says what kind of business you are, where you are, how to reach you and when you're open.
This guide is for owners and the people who build their sites. It explains what a JSON-LD block contains, walks through a full example for a US dental office one field at a time, and covers where to put it, how to test it and what goes wrong. For the bigger picture of which schema types to use, start with our schema markup guide.
Why JSON-LD instead of other formats?
Structured data can be written three ways: JSON-LD, Microdata and RDFa. Microdata and RDFa add attributes to your existing HTML tags, so the facts are spread through the page. JSON-LD sits in one self-contained script block, separate from the design.
That separation is the practical win. A designer can change the page layout without breaking the markup, and a developer can update the markup without touching the layout. Google's documentation says it recommends JSON-LD and that it can read JSON-LD even when it's added to the page by JavaScript.
What goes in a LocalBusiness JSON-LD block?
Below are the fields of a full example for a fictional dental office in Raleigh, North Carolina. In the page's code, each field is a name in quotes followed by its value, and the whole block sits inside a script tag with the type application/ld+json.
| Field | Example value | What it tells software |
|---|---|---|
@context | https://schema.org | Which vocabulary the labels come from |
@type | Dentist | What kind of business this is; use the most specific type that fits |
@id | https://example-dental.com/#business | A fixed identifier for your business, so other blocks can refer to it |
name | Oak Street Family Dental | Your business name, exactly as on your Google Business Profile |
url | https://example-dental.com/ | Your main website address |
telephone | +1-919-555-0142 | Your main phone, with country code |
address | a PostalAddress with streetAddress, addressLocality, addressRegion, postalCode, addressCountry | Your street address, split into parts |
geo | a GeoCoordinates with latitude and longitude | Your exact location on a map |
openingHoursSpecification | a list, each with dayOfWeek, opens, closes | Your hours, in 24-hour time |
areaServed | Raleigh, Cary, Garner | The places you serve |
image | https://example-dental.com/office.jpg | A photo of your business |
priceRange | a short text range | A rough price level, if you choose to state one |
sameAs | links to your profiles on other sites | Which other pages describe the same business |
The 555 number and the address are fictional. Use your own facts, and only facts that also appear on the visible page.
How do the nested parts work?
Three fields hold a small block of their own instead of a single value.
address holds a PostalAddress. Each part goes in its own field: street in streetAddress, city in addressLocality, state as the two-letter code in addressRegion, ZIP in postalCode, and US in addressCountry. Splitting it this way stops software from misreading a suite number as part of the city.
geo holds a GeoCoordinates block with latitude and longitude. Google asks for at least five decimal places. You can copy the numbers from Google Maps by right-clicking your location.
openingHoursSpecification holds a list. Each entry gives one or more days, an opening time and a closing time, such as Monday to Thursday, 08:00 to 17:00, then a separate entry for Friday, 08:00 to 13:00. For a day you're closed, leave it out. For special hours, such as a holiday, add an entry with validFrom and validThrough dates.
What about the @id field?
The @id is easy to skip and worth adding. It gives your business a fixed identifier, usually your homepage address followed by #business or #organization. Other JSON-LD blocks on your site, such as a Service on a service page or the publisher of a blog post, can then point to that identifier instead of repeating your details. One definition, referenced everywhere, means fewer conflicting copies.
How do you mark up a service page?
On each service page, add a Service block. Its key fields:
| Field | Example value |
|---|---|
@type | Service |
name | Emergency dental visits |
serviceType | Emergency dentistry |
provider | a reference to your business @id |
areaServed | Raleigh |
description | one or two plain sentences that match the page |
Keep the description in step with the visible text. If the page says you see emergency patients on Saturdays, the description can say so too; if it doesn't, the markup shouldn't.
Check whether ChatGPT names your business when buyers ask about your services. One free report per business. Use your business email. No card.
Where do you put the JSON-LD block?
Google reads JSON-LD in the head or the body of the page. Common choices:
- The homepage, or the contact page, carries the main LocalBusiness block.
- Each service page carries a Service block that refers to the business by its
@id. - Each location page, for firms with several offices, carries its own LocalBusiness block with that office's address, phone and hours. Don't put every office on the homepage in one block.
- Blog posts carry an Article or BlogPosting block with the author, headline and dates.
If your site runs on WordPress or a website builder, a plugin or the platform may already output some of this. Check what's there before adding your own, or you'll end up with two conflicting blocks.
How do you test JSON-LD?
Test every page template, starting with the homepage.
- Paste the page address into Google's Rich Results Test. It shows the structured data Google found and any errors in the types it supports.
- Paste the same address into the Schema Markup Validator at validator.schema.org. It checks all Schema.org types, including ones Google doesn't use for rich results.
- In Google Search Console, watch the Enhancements reports. They list errors across the whole site as Google crawls it.
A clean test means Google can read the markup. It doesn't mean Google will show a rich result; that's Google's call.
What mistakes stop JSON-LD from working?
| Mistake | What happens | Fix |
|---|---|---|
| A missing comma or bracket | The whole block fails to parse and is ignored | Run it through a validator after every edit |
| Curly quotes from a word processor | The block fails to parse | Write it in a code editor, never in a document tool |
| Facts not on the visible page | Breaks Google's guidelines; may be ignored or penalized | Mark up only what visitors can see |
| Phone or address differs from your Business Profile | Conflicting facts across the web | Use one exact version everywhere |
| Self-serving review stars on LocalBusiness | Google doesn't show them | Remove them |
| Several plugins each adding a block | Duplicate businesses on one page | Keep one source |
| Hours not updated for a change | Wrong hours spread to other software | Update markup with the page |
Curly quotes catch more people than you'd expect. JSON needs straight quotation marks. Text pasted from a word processor or an email often converts them, and one bad quote breaks the whole block.
Does JSON-LD help with AI answers?
Indirectly. Google's AI features use its search index, and structured data helps Google understand pages in that index. AI tools that browse the web read the page, markup included. Google's guidance on AI features doesn't list any special markup as required, though, and no AI company has published how much weight it gives to markup.
The safe view: JSON-LD makes your basic facts unambiguous. The text of the page does the persuading. If you want AI tools to name you, the bigger levers are clear service pages, consistent facts across listings and mentions on sites those tools read. Our post on how to rank in ChatGPT covers those.
A checklist before you publish
- The
@typeis the most specific one that fits. - Name, address and phone match your Google Business Profile exactly.
- Hours are in 24-hour time and match the page.
- The block passes both validators.
- Only one block describes the business on each page.
- Someone owns updates when facts change.
How does Seen in Search fit in?
JSON-LD helps machines read your facts. Whether AI tools name you is a separate question, and you can measure it. A Seen in Search report reads your homepage, writes buyer questions based on what you sell, puts them to AI assistants and scores how visible you are in the answers, in code, with fixed, published weights. The free report checks ChatGPT. The full paid report covers ChatGPT, Google AI Overviews and Perplexity. Our methodology page explains the score. Reports are private when they finish.
Questions developers and owners ask about JSON-LD
Is JSON-LD the same as schema markup?
Where do I put JSON-LD in WordPress?
Can JSON-LD go in the body instead of the head?
How many JSON-LD blocks can a page have?
What is the @id in JSON-LD?
Why does Google ignore my JSON-LD?
Should every page have LocalBusiness JSON-LD?
Can I generate JSON-LD with a free tool?
Does JSON-LD slow down my website?
Do AI tools like ChatGPT read JSON-LD?
One free report per business, private unless you publish it. Use your business email. No card. Questions about the report? Contact us.


