JSON
JSON Formatter / Minify / Validator
تنسيق (مسافة بادئة بمقدار حرفين) وضغط والتحقق من JSON مباشرة في المتصفح.
JSON Formatter turns any JSON into a readable, indented form, compresses it into a single compact line, or checks it for syntax errors. Everything runs in your browser — nothing you paste is sent anywhere.
How to use it
- Format: paste JSON into the input — a 2-space indented result appears immediately.
- Minify: switch to Minify mode to get compact JSON with no whitespace, ready to embed in code or send over the network.
- Validate: if the JSON is invalid, the tool points to the exact line and character where the syntax error occurs.
Common uses
- Reading an API response that arrived as one long unbroken line.
- Checking configuration files (package.json, tsconfig.json, etc.) before a commit.
- Minifying JSON before pasting it into an environment variable or a one-line config.
Things to keep in mind
Formatting never changes data types or key order — only the whitespace and line breaks around values.
Valid JSON doesn't allow trailing commas, comments, or single quotes — if your input has those, run it through JSON Repair first.
مقالة عن هذه الأداة: JSON Formatter: التنسيق والتصغير والتحقق
الأسئلة الشائعة
ما الفرق بين وضعي Format وMinify؟
يضيف Format مسافة بادئة بمقدار حرفين لجعل JSON قابلاً للقراءة، بينما يزيل Minify كل المسافات غير الضرورية بين الرموز لتصغير الحجم، دون أن يمسّ ذلك محتوى القيم النصية نفسها.
هل JSON الذي ألصقه يُرسل إلى أي خادم؟
لا، كل المعالجة تتم بالكامل داخل المتصفح عبر JavaScript، ولا يُرفع أي شيء إلى أي خادم.
لماذا تظهر رسالة خطأ رغم أن JSON يبدو صحيحًا وفيه فاصلة زائدة؟
الفاصلة الزائدة (trailing comma) قبل قوس الإغلاق غير صالحة في معيار JSON حتى لو كانت بعض لغات البرمجة تسمح بها، لذا ستظهر كخطأ في التحقق.
ما الفرق بين JSON5 أو JSONC وJSON القياسي؟
هذه امتدادات تسمح إضافيًا بالتعليقات والفواصل الزائدة والمفاتيح بلا علامات اقتباس. المُحقِّق الصارم لـJSON (مثل هذه الأداة) سيرفض هذا النص بحق — فهو يحتاج محلِّلًا منفصلًا يدعم JSON5/JSONC صراحة.
هل يغيّر التنسيق أنواع البيانات، مثل الأرقام؟
لا، التنسيق والتصغير يعيدان ترتيب المسافات وفواصل الأسطر حول القيم فقط. الأرقام والسلاسل والقيم المنطقية وnull تبقى كما هي دون تغيير.