Text to hex (UTF-8)

Encodes text to hex per UTF-8 byte; decodes continuous hex or spaced hex.

Overview

Hexadecimal exists for a practical and elegant reason: computers speak in binary, but binary is nearly unreadable for humans. Before hex, octal (base 8) was the standard on early computers such as the DEC PDP-8 in the 1960s — the original Unix was developed on machines where memory addresses were noted in octal, and you can still see traces of this today: `chmod 755` is octal notation. Hexadecimal won out because of one irresistible mathematical fact: one hex digit represents exactly 4 bits (one nibble), and one byte is exactly 2 hex digits. There is never any waste, never any ambiguity. The maximum byte is `FF` (255), the minimum is `00`. The IBM System/360 mainframe, launched in 1964, popularized hex at scale, and from that point the convention became universal in computing.

The classic use of hexadecimal representation is inspecting the raw bytes of files. Every file format has a signature in its first bytes — the so-called magic numbers — that identifies the type regardless of extension. A PNG file always begins with `89 50 4E 47 0D 0A 1A 0A`. JPEG begins with `FF D8 FF`. ZIP files start with `50 4B 03 04` — which in ASCII spells `PK`, the initials of Phil Katz, creator of PKZip. PDF begins with `25 50 44 46`, which is `%PDF`. A hex editor lets you see these bytes directly, essential for digital forensics, recovering corrupted files, and writing parsers for binary formats. Tools like Wireshark and tcpdump display network packet content in hex with the ASCII interpretation alongside — it is the canonical way to debug protocols.

For anyone working with Portuguese, Spanish, or any accented language, hex conversion reveals something non-obvious: many characters you type every day occupy more than one byte in UTF-8. The letter `ã` is 2 bytes: `C3 A3`. The `é` is `C3 A9`. The `ç` is `C3 A7`. The word `ação` has 4 characters but 7 bytes in UTF-8. This seems like a detail until you work with network protocols that have fixed-size byte fields, databases that distinguish `VARCHAR(10)` in characters versus bytes, hash functions that operate on bytes (the SHA-256 of `ação` differs depending on whether you pass the 7-byte UTF-8 string or a 4-byte encoding), or cryptographic operations that require 16-byte block alignment. Seeing the actual bytes of a string eliminates any ambiguity.

Technical deep dive

Common questions summarized

  • What is this tool for?: It runs fully in your browser: useful to validate, format, or convert data in everyday development.
  • Are my inputs sent to a server?: Processing happens locally with JavaScript. We do not store what you paste into the text areas.
  • Can I use this for real production data?: Use at your own risk. For secrets (passwords, tokens), prefer controlled environments and your company policies. And always review the generated contents. Never trust blindly things you see on the internet.

Sample payload to try

  • See also the larger "Code Snippets" sample; paste this excerpt to try locally: Sample — Olá → bytes UTF-8 em hex

Tool guide

  • What UTF-8 text is Unicode text encoded as bytes. One character may use one or more bytes.

  • What hexadecimal representation is Each byte is shown as two hex digits (00–FF), useful to inspect the raw bytes behind the text.

  • What the tool does Encodes a string to UTF-8 bytes in hex, or decodes hex (with or without spaces) back to text.

  • Why use it Debug encoding, compare with network dumps or logs, teach or verify how many bytes a character uses.

Code Snippets

Code example
Olá → bytes UTF-8 em hex

Sample

Olá → bytes UTF-8 em hex

FAQ

What is this tool for?

It runs fully in your browser: useful to validate, format, or convert data in everyday development.

Are my inputs sent to a server?

Processing happens locally with JavaScript. We do not store what you paste into the text areas.

Can I use this for real production data?

Use at your own risk. For secrets (passwords, tokens), prefer controlled environments and your company policies. And always review the generated contents. Never trust blindly things you see on the internet.