Converting files to Strings

This page helps you to convert a file into a quoted JavaScript string of bytes.

It's useful if:

  • You're making a webserver and you want to encode an image in a string.
  • You want to turn a raw bitmap into something that you can send to a display (you may also want to look at the Image Converter in that case).

To use it just click 'Choose File'. Once the file is chosen, various string representations of it will be output in the text area below. You can then copy and paste them into your JS code.

Quoted String

...

Base64 encoded

...

Templated String

...

This page is auto-generated from GitHub. If you see any mistakes or have suggestions, please let us know.