I don’t quite understand your question. JSON is just the javascript object notation which is a text based serialization format. It is just text. You seem to put that serialized text through the BinaryFormatter which makes not much sense since binary serialized text will still be text and is exactly what you see in your image. Hexadecimal is also just a text encoding for numbers. The JSON format does not support any kind of hexadecimal values.
If you wanted to ask how to store a ScriptableObject to a file at runtime so that a user can not directly read the content, that’s something completely different. To make it harder to read your data you could of course convert your string into a byte array and convert the byte array to a hexadecimal string. This will exactly double the size of the resulting string. A usually better approach is to convert your byte array to base64 which doesn’t have as much overhead. The data is still larger though by about 33%
Another way is to actually compress your data using any sort of compression algorithm. Of course most compression libraries are quite large. Alternatively you could use my Huffman encoder. I just added “EncodeFromUTF8” and “DecodeToUTF8” to directly convert a string to a huffman encoded byte stream. For short strings the result is usually a bit larger than the input string since the whole huffman tree is included in the byte stream. However unless you know how the data is actually encoded most people would have a hard time to decipher the data ^^. Note that this is not meant as any kind of security.
To sum up: We assume you have already serialized your ScriptableObject to json.
With my Huffman script you can use:
byte[] data = B83.Compression.Huffman.EncodeFromUTF8(json);
File.WriteAllBytes(Application.persistentDataPath + fileName, data);
to write the huffman encoded bitstream to the file.
To read the json back, use this:
byte[] data = File.ReadAllBytes(Application.persistentDataPath + fileName);
json = B83.Compression.Huffman.DecodeToUTF8(data);
If you want to just encode your json text as hexadecimal characters, you can use those two helpers from StackOverflow in a similar way
// save
string data = HexadecimalEncoding.ToHexString(json);
File.WriteAllText(Application.persistentDataPath + fileName, data);
// load
string data = File.ReadAllText(Application.persistentDataPath + fileName);
json = HexadecimalEncoding.FromHexString(data);
Likewise if you prefer base64 you can just use
// save
string data = System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(json));
File.WriteAllText(Application.persistentDataPath + fileName, data);
// load
string data = File.ReadAllText(Application.persistentDataPath + fileName);
json = System.Text.Encoding.UTF8.GetString(System.Convert.FromBase64String(data));
Keep in mind that base64 encoding can easily be reverted, even with online tools like this one. The same is true for hexadecimal strings. As I said there is probably no converter for my custom huffman encoding, but if someone analysis your code he could figure it out.