Parse before render
The pasted text is parsed against the grammar of the selected format before anything is rendered - JSON per RFC 8259, XML per its tag and attribute well-formedness rules. For JSON and XML, input that breaks the grammar is treated as invalid and the tool will not format it until the underlying issue is fixed. HTML is different: its standard parsing model defines error recovery for malformed markup, so near-miss HTML generally still produces some rendered structure rather than being rejected outright.