A quick way to pretty-print JSON in Elixir is by using the Jason library.

You can install it by adding this to your dependencies:

{:jason, "~> 1.4"}

The next step it to have a variable with the JSON data you want to pretty-print:

json = """
{"hello": "world"}
"""

Pretty-printing then is a easy as:

pretty_printed_json = Jason.Formatter.pretty_print(json)