There are lots of online JSON viewer and I’ve alwasy used this one:
Today, instead, I’ve needed an editor in order to write a sample JSON for sharing it with a customer.
I tried some editors and this one has won:
It allows you to design the json using a tree and generate JSON string or viceversa.
In addition you can save it in order to share the url or edit it later.