Skip to content

JSON / YAML / PHP Formatter

Validate, format, and convert between JSON, YAML, and PHP array syntax with syntax highlighting and tree view.

[Lab Tool] [Developer Utilities]

All processing happens locally in your browser. No data is sent to any server.


                            

JSON Reference (RFC 8259)

Data Types

  • string - "text in quotes"
  • number - 123, -45, 3.14
  • boolean - true, false
  • null - null
  • array - [1, 2, 3]
  • object - {"key": "value"}

Common Errors

  • Trailing comma in array/object
  • Single quotes instead of double
  • Unquoted keys
  • Comments (not allowed)
  • Undefined values

Escape Sequences

  • \" - Double quote
  • \\ - Backslash
  • \n - Newline
  • \t - Tab
  • \uXXXX - Unicode

Best Practices

  • Use consistent indentation
  • Sort keys for readability
  • Validate before use
  • Minify for production
  • Use meaningful key names