Way to quickly check if string is XML or JSON in C# May 31, 2023 by Tarik Very simple: Valid JSON starts always with ‘{‘ or ‘[‘ Valid XML starts always with ‘<‘ I’m talking about non-space data.