attoh.tech · Free tool

Free Schema.org JSON-LD Generator

Structured data for rich Google results — Organization, LocalBusiness, Person, Product.

Want rich results across your whole site?

Structured data is one layer of the SEO build ATTOH ships for every brand.

See ATTOH marketing
`; return { jsonld, object: obj, issues, valid: issues.length === 0 }; } /* ── tool ── */ const meta = { id: 'schema-generator', title: 'Free Schema.org JSON-LD Generator', tagline: 'Structured data for rich Google results — Organization, LocalBusiness, Person, Product.', seoDescription: 'Free Schema.org JSON-LD generator. Build valid structured data for Organization, LocalBusiness, Person or Product, with recommended-field checks. Paste into your page for rich results.', keywords: ['schema generator', 'JSON-LD generator', 'structured data', 'rich results', 'local business schema', 'free SEO tool'], vertical: 'marketing-law', product: 'attoh.tech', cta: { text: 'Want rich results across your whole site?', button: 'See ATTOH marketing', href: 'https://attoh.tech' }, ctaBody: 'Structured data is one layer of the SEO build ATTOH ships for every brand.', inputs: [ { name: 'type', label: 'Type', type: 'select', default: 'Organization', options: [ { value: 'Organization', label: 'Organization' }, { value: 'LocalBusiness', label: 'LocalBusiness' }, { value: 'Person', label: 'Person' }, { value: 'Product', label: 'Product' }, ] }, { name: 'name', label: 'Name', type: 'text', default: 'ATTOH Digital' }, { name: 'url', label: 'URL', type: 'text', default: 'https://attoh.tech' }, { name: 'description', label: 'Description', type: 'text', default: '' }, { name: 'logo', label: 'Logo URL', type: 'text', default: '' }, { name: 'telephone', label: 'Telephone', type: 'text', default: '' }, { name: 'address', label: 'Street address', type: 'text', default: '' }, { name: 'sameAs', label: 'Social profile URLs (comma-separated)', type: 'text', default: '' }, ], }; function compute(v) { const r = generateSchema(v); return { score: r.valid ? 100 : Math.max(0, 100 - r.issues.length * 20), code: { label: 'Paste into your or before ', content: r.jsonld }, issues: r.issues, note: r.valid ? 'All recommended fields present.' : 'Add the recommended fields for the best rich-result eligibility.', }; } /* ── harness ── */ const form = document.getElementById('tool-form'); const resultEl = document.getElementById('result'); function coerce(el){ if(el.type==='number'){ const n=parseFloat(el.value); return Number.isFinite(n)?n:0; } return el.value; } form.addEventListener('submit',(e)=>{ e.preventDefault(); const values={}; for(const el of form.querySelectorAll('[data-name]')) values[el.dataset.name]=coerce(el); let out; try{ out=compute(values); }catch(err){ resultEl.hidden=false; resultEl.innerHTML='

Error: '+escapeHtml(String(err.message||err))+'

'; return; } const parts=[]; if(typeof out.score==='number') parts.push('

'+out.score+' / 100

'); if(Array.isArray(out.rows)&&out.rows.length){ parts.push(''+out.rows.map(r=>'').join('')+'
'+escapeHtml(r.label)+''+escapeHtml(r.value)+'
'); } if(out.code&&out.code.content){ const id='code'+Math.floor(Math.random()*1e6); parts.push((out.code.label?'

'+escapeHtml(out.code.label)+'

':'')+'
'+escapeHtml(out.code.content)+'
'); } if(Array.isArray(out.issues)&&out.issues.length){ parts.push(''); } if(out.note) parts.push('

'+escapeHtml(out.note)+'

'); resultEl.innerHTML=parts.join('')||'

No result.

'; resultEl.hidden=false; }); resultEl.addEventListener('click',(e)=>{ const b=e.target.closest('.copy'); if(!b)return; const pre=document.getElementById(b.dataset.c); if(pre) navigator.clipboard?.writeText(pre.textContent); b.textContent='Copied'; }); function escapeHtml(s){ return String(s).replace(/&/g,'&').replace(//g,'>'); }