JSON and YAML processor
JSON support is native to PHP. Full YAML parsing is enabled only when the server provides the PECL yaml extension backed by LibYAML.
JSON is a data interchange format, not just “JavaScript object syntax”
RFC 8259 defines a JSON text as a serialized value. A top-level JSON document can therefore be an object, array, string, number, true, false or null. JSON exchanged between systems outside a closed ecosystem must use UTF-8 for interoperability.
Formatting changes presentation, not the intended data model
Pretty-printing adds indentation and line breaks to make JSON easier to inspect. This page parses the document and serializes it again, so it should not be used when byte-for-byte preservation, original whitespace or lexical number formatting must be retained.
Valid JSON can still be problematic for interoperability
RFC 8259 says object member names should be unique. When duplicate names occur, parsers differ: some keep only the last value, some report an error and others preserve all pairs. A parse-and-reformat tool can therefore lose information from JSON objects with duplicate member names even when the input is accepted syntactically.
JSON number syntax does not guarantee arbitrary numeric precision
RFC 8259 allows implementations to impose numeric range and precision limits and notes that IEEE 754 binary64 is a common interoperability baseline. This page asks PHP to preserve integers that exceed its native integer range as strings during decoding, reducing accidental integer truncation, but conversions between JSON and YAML can still change type semantics for extreme numeric values.
YAML is richer than JSON
YAML 1.2 supports mappings, sequences and scalars, but its representation model also includes features such as tags, anchors and aliases. YAML 1.2 defines a JSON schema and is designed with JSON compatibility in mind, yet a general YAML document can express representation details that do not map one-to-one to plain JSON.
Converting YAML to JSON can be lossy even when parsing succeeds
Anchors identify nodes for later aliases, and tags carry type or application metadata. After YAML is composed into native PHP values and then serialized as JSON, presentation details, anchor names and YAML-specific tagging semantics may no longer exist. Use this converter for data transformation, not as a round-trip YAML editor.
Why YAML → JSON may be unavailable on this installation
PHP core provides JSON functions, while the YAML functions used here come from the PECL yaml extension and are handled by LibYAML. When that extension is absent, this page refuses full YAML parsing instead of implementing a fragile subset parser that could silently reinterpret configuration data.
YAML parsing needs a server-side security decision
The PHP yaml_parse() manual warns that processing untrusted input is dangerous when unserialize support for !php/object nodes is enabled through yaml.decode_php. Because this is a public web utility, the page refuses YAML parsing when that setting is enabled instead of accepting the risk.
The built-in fallback is intentionally one-way and conservative
Without PECL yaml, JSON → YAML still works for the JSON data model. The fallback quotes all strings and mapping keys, preserves booleans and null explicitly and emits nested arrays and mappings. It does not claim support for YAML anchors, aliases, tags, directives, block scalars, comments or arbitrary YAML input.
Validation-only workloads can avoid building the decoded structure
PHP 8.3 introduced json_validate(), which can validate syntax with less memory when the parsed value is not needed. This page also reports structural metadata after validation, so it decodes once instead of calling json_validate() and then decoding the same input a second time.