Format valid JSON with readable indentation, optional key sorting, and a trailing newline.
—
The input is parsed and serialized with configurable indentation, optional key sorting, and optional trailing newline. Parsing first ensures the result is valid JSON rather than merely aligned text.
{"name":"Alice","age":30,"roles":["admin","user"],"address":{"city":"Portland","state":"OR"}}
{
"name": "Alice",
"age": 30,
"roles": [
"admin",
"user"
],
"address": {
"city": "Portland",
"state": "OR"
}
}
API inspection, repository configuration, and documentation examples format JSON.