Validate JSON String

Check if a string is valid JSON that can be parsed.

Code

Utilities
try { JSON.parse(str); true; } catch { false; }

Parameters

String to validate.

Browser·fetch() may be limited by CORS

More JavaScript Snippets