انتقل إلى المحتوى
Toolioz logoToolioz
تنسيق البيانات

منسّق JSON وأداة التحقّق

نسّق بيانات JSON وتحقّق منها وصغّرها أو حوّلها إلى YAML أو TypeScript في متصفحك.

التنسيق
التحويل

النتيجة

(سيظهر الناتج هنا بعد التنسيق)
ملخص وإجابة مباشرة
أدوات المطورين

Format, validate, and convert JSON to TypeScript or YAML

This page pretty-prints JSON with 2 or 4 spaces, minifies it, and can emit YAML or TypeScript from a value that parses. The text is not uploaded. The site still loads scripts and analytics.

النقاط الأساسية

  • Pasted JSON stays in the tab when the page is labelled local processing. Analytics for the website still load.
  • TypeScript interfaces come from json-to-ts and the parsed sample.
  • The YAML converter turns parsed JSON into YAML syntax.
  • A parse error shows the JSON.parse message. The page does not highlight a line.

الأسئلة الشائعة

يُجرى التنسيق والتحويل في علامة التبويب هذه عند الإشارة إلى المعالجة المحلية. لا تُرفع بيانات JSON إلى Toolioz. يستمر الموقع في تحميل البرامج النصية وأدوات التحليلات.

تستخدم صيغة YAML مكتبة js-yaml بمسافتين بادئتين. وتستخدم TypeScript حزمة json-to-ts لمعالجة القيمة المحلّلة. يُنفّذ الإجراءان بعد نجاح JSON.parse. لا يُرفع النص.

يرفض JSON.parse الفاصلة الزائدة وعلامات الاقتباس المفردة والمفاتيح غير المقتبسة. تعرض الصفحة رسالة المحلّل دون تمييز السطر. لا يُرفع النص.

ملاحظات الناشر · تاريخ المراجعة 10 September 2026

What this JSON formatter does with invalid input

The formatter pretty-prints JSON that already parses, and it reports the first syntax error when the text is not JSON. It is not a schema validator and it does not send the document to Toolioz when the page is labelled local processing.

Parse errors you will actually see

JSON requires double-quoted keys, no trailing commas, and no comments. A trailing comma after the last property is valid in JavaScript objects and invalid in JSON. Single quotes around strings fail. `undefined` is not a JSON value. The engine stops at the first violation and shows a position; fix that before looking for a second error.

Huge minified files can freeze a tab because parsing is synchronous on the main thread. Split the file or use a desktop tool if the browser complains. Formatting does not prove the payload matches an API contract. That check is JSON Schema, on a different page.

Privacy note

Tokens, passwords, and PII pasted here stay in the tab only if the page states local processing. The website still loads scripts and analytics. Do not paste production secrets into any website, including this one, if your policy forbids it.

أمثلة محلولة

  • Trailing comma

    {"ok": true,} fails. {"ok": true} parses. Remove the comma after true.

حدود هذه الصفحة

  • Does not repair YAML, TOML, or JavaScript object literals automatically.
  • Duplicate keys: JSON.parse keeps the last value; that may not be what the API author intended.

المصادر