Skip to content

About

JSONPilot: 44 free JSON tools in your browser. Validate, format, repair, convert to CSV/Excel/YAML/SQL and generate types.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

JSONPilot

The source of jsonpilot.com: 44 free, private JSON tools that run in your browser.

Live site · About JSONPilot · Report a bug or suggest a tool · Contributing

JSONPilot in dark mode: the JSON Validator and Formatter with formatted sample JSON, line numbers and a Valid JSON status

Validator, formatter, repair, viewers, converters, code generators and more. Built with Next.js 16 (App Router) + TypeScript, exported as a static site. All JSON processing happens in the browser; there is no backend.

Commands

Requires Node.js 26 (the current LTS; see .nvmrc). With nvm: nvm install 26 && nvm use.

Command What it does
npm install Install dependencies
npm run dev Dev server at http://localhost:3000 with hot reload
npm run build Production build → static files in out/
npm start Serve out/ at http://127.0.0.1:4173 (same URL rules as .htaccess)
npm run check Typecheck + lint + unit tests (run before committing)
npm run typecheck / lint / test The individual checks (test:watch for watch mode)
npm run test:e2e Browser tests against out/ (run npm run build first; uses installed Google Chrome)

Deploying

The site deploys to Vercel from GitHub: every push to main goes live, every pull request gets its own preview URL, and GitHub Actions runs the full test suite on both. The same code can also be uploaded to any static host (Apache) — see the end of this section.

1. Put the code on GitHub (once)

  1. On github.com, create a new empty repository (for example jsonpilot; private is fine). Don't add a README, .gitignore or licence — the project already has them.

  2. In this folder, merge the work into main and push:

    git checkout main
    git merge improvements
    git remote add origin https://github.com/<your-account>/jsonpilot.git
    git push -u origin main
  3. Open the repository's Actions tab: the CI workflow (typecheck, lint, unit tests, build, browser tests) should go green in about 5 minutes.

2. Connect Vercel (once)

  1. Sign in at vercel.com with GitHub → Add New… → Project → Import the repository (allow the Vercel GitHub app to access it when asked).
  2. Leave the detected settings as they are: Framework Next.js, default build and output settings, no environment variables. Node.js 26 is picked up from package.json (engines.node).
  3. Click Deploy. When it finishes, open the *.vercel.app URL and check a few tools.

3. Point jsonpilot.com at Vercel

  1. In the Vercel project: Settings → Domains → add jsonpilot.com, then add www.jsonpilot.com and choose Redirect to jsonpilot.com (permanent).
  2. At your domain registrar, create the DNS records Vercel shows on that page — usually an A record for @ and a CNAME for www. Use the exact values Vercel displays.
  3. Vercel issues the HTTPS certificate automatically once DNS has updated (minutes to a few hours). Keep the old host running until then so there is no downtime.
  4. Afterwards, check: http:// and www. both end up on https://jsonpilot.com, /about.php redirects to /about, and /sitemap.xml loads. Then submit the sitemap in Google Search Console (the verification file in public/ keeps the property verified).

Day-to-day workflow

  • Change something: work on a branch, push, open a pull request. Vercel comments with a preview URL and CI runs the tests. Merge when both are green — Vercel deploys main to production.
  • Roll back: in Vercel → Deployments, open an earlier deployment → Promote to Production.
  • Google Analytics only runs on jsonpilot.com, so previews never pollute your statistics.
  • The CSP blocks Vercel's comment toolbar on preview deployments. If you want it, add https://vercel.live to script-src, connect-src and a frame-src in next.config.ts.

How the two hosting modes differ

Vercel (VERCEL=1 during the build) Static export (npm run build anywhere else)
Output Next.js on Vercel (all pages still prerendered) Plain files in out/
Security headers, redirects next.config.ts public/.htaccess
HTTPS, www → apex Vercel Domains settings public/.htaccess

Keep the security headers in next.config.ts and public/.htaccess in sync if you change them. To try the Vercel mode locally: VERCEL=1 npm run build && VERCEL=1 npx next start.

Static hosting (Apache) instead

npm run build, then upload the contents of out/ to the web root, including the hidden .htaccess (some FTP clients skip dotfiles). It provides clean URLs, HTTPS and www redirects, 301s from the old .php URLs, the 404 page, security headers and caching. Requires mod_rewrite and mod_headers; mod_deflate and mod_expires are recommended.

Bump VERSION in public/sw.js only if you change the service worker's caching rules — page and asset updates are picked up automatically.

How it fits together

  • One registry drives everything. lib/tools.ts lists every tool: id (= URL slug), group, menu label, and its page copy (title, SEO description, how-to, notes). The header menus, footer, /tools hub, related-tool cards, sitemap and per-tool Open Graph images are all generated from it.
  • One route renders every tool. app/[tool]/page.tsx statically generates a page per registry entry. components/tools/ToolRenderer.tsx picks the UI and loads it with next/dynamic, so each page only downloads the code for its own tool.
  • Most tools are converters. components/tools/converters.ts defines input/output editors, options and a run() for each; ConverterTool.tsx is the shared two-pane UI. Engines in lib/convert/ are imported lazily inside run().
  • Exact numbers. lib/json.ts is a strict JSON parser/serializer that keeps numbers that JSON.parse would change (12345678901234567890, 1.10) as LosslessNumber, and reports duplicate keys. Use its parse/stringify instead of the JSON built-ins when handling user data.

Structure

app/
├── layout.tsx               <html>, fonts, default metadata, header/footer, analytics, service worker
├── page.tsx                 home: editor, all tools, features, FAQ (+ Organization/WebSite/FAQ JSON-LD)
├── [tool]/page.tsx          every tool page (generateStaticParams over lib/tools.ts)
├── [tool]/opengraph-image.tsx   1200×630 social image per tool
├── tools/page.tsx           /tools hub (all tools by group)
├── about/ contact/ terms/ privacy-policy/
├── opengraph-image.tsx      default social image
├── not-found.tsx            404 page
└── sitemap.ts robots.ts manifest.ts globals.css
components/
├── Header.tsx Footer.tsx Breadcrumbs.tsx ToolPage.tsx ToolCards.tsx ToolDirectory.tsx
├── Analytics.tsx CookieSettings.tsx   Google Analytics, loaded only after consent
├── ServiceWorker.tsx        registers public/sw.js (offline support) in production
├── json-tool/               main editor: JsonTool.tsx, editor.ts (CodeMirror), JsonTree.tsx,
│                            jsonOps.ts + json.worker.ts (large files are processed in a worker)
└── tools/                   ConverterTool + converters.ts, DiffTool, MergeTool, SchemaTool,
                             TableTool, ExcelTool, ToolRenderer, CodeEditor, Pane, Options, Status
lib/
├── tools.ts                 tool registry (see above)
├── json.ts                  lossless JSON parser/serializer
├── convert/                 pure engines: csv, xml, yaml, sql, excel, markdown, flatten, diff, merge,
│                            schema (Ajv), schema-gen, codegen, repair (+ JSONC/JSON5), query (JSONPath),
│                            encode (escape/Base64/JWT), size, tokens, table, analyze
├── share.ts                 compressed share links (#json=…, never sent to the server)
├── consent.ts               analytics consent storage
├── og.tsx metadata.ts site.ts content.ts browser.ts
public/                      .htaccess, sw.js, icons, images, browserconfig, Google verification
tests/unit/                  Vitest tests for lib/ (npm test)
tests/e2e/                   Playwright tests + a static server that mirrors .htaccess
.github/workflows/ci.yml     CI on every push / pull request (typecheck, lint, tests, build, e2e)
next.config.ts               Vercel headers/redirects, or static export everywhere else

Common changes

  • New tool: add an entry to TOOLS in lib/tools.ts. If it is a converter, add a definition with the same id to converters.ts and it is rendered automatically; otherwise add a case to ToolRenderer.tsx. The menu, footer, /tools, sitemap and OG image pick it up.
  • Header dropdowns: NAV_MENUS in lib/tools.ts.
  • Social links: SOCIAL_LINKS in lib/site.ts (entries with an empty href are hidden).
  • New static page: create app/<slug>/page.tsx, export metadata = pageMeta({...}), and add it to PAGES in lib/site.ts for the sitemap.
  • FAQ / features: lib/content.ts (the FAQ JSON-LD updates automatically).

About

JSONPilot: 44 free JSON tools in your browser. Validate, format, repair, convert to CSV/Excel/YAML/SQL and generate types.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages