Image to Bytecode

Convert image files into Base64, Data URL, hexadecimal bytes, JSON byte arrays or JavaScript Uint8Array source for development and API integration.

Bytecode output

How this tool helps

Convert an image file into representations commonly used by developers, APIs and source code: raw Base64, a complete Data URL, hexadecimal bytes, a JSON byte array or JavaScript Uint8Array source.

  • Base64 is useful for transport through text-only formats but increases size by roughly one third.
  • Data URLs include the MIME type and can be assigned directly to image src attributes.
  • Hex, JSON bytes and Uint8Array output are useful when debugging binary protocols or embedding test fixtures.

Worked example: Convert an image for a development workflow

  • Choose a PNG image from your device
  • Select Base64, Data URL, hex, JSON bytes or Uint8Array
  • Copy the generated representation

The tool reads the selected file bytes and encodes those bytes in the chosen representation. A Data URL also includes the detected MIME type.

Base64 is a text encoding, not encryption, and typically makes the representation larger than the original binary file.

Frequently asked questions

Is bytecode the same as Base64?

Not exactly. Base64 is one textual encoding of binary bytes. This tool also exposes the bytes as hexadecimal, numeric arrays and Uint8Array source.

Does conversion change the image?

No. The tool reads the original file bytes and encodes those exact bytes into the selected representation.

Is the image uploaded?

No. The conversion runs locally in your browser.

Local processing

Conversion happens in your browser. The selected image or byte data is not intentionally uploaded to our server.