← Cryptography guide

K084 / Encoding and decoding

Hex Base16

hexadecimal Base16 encoding · Survey date 2026-12-05

Base16 is hexadecimal encoding representing binary data with the characters 0–9 and A–F.

CRYPTOGRAPHY LAB / K084

Cryptography Lab · Hex Base16

Run real computations and inspect intermediate states step by step.

Educational only. Never enter real passwords or secret keys. Computation stays in your browser; input and trace values are not sent to a server. Do not use this implementation in production.

Scope: Standard operation

Base16 / HEX

See the scope above for fixed examples, reduced parameters and supported variants. Standard operation names and formulas are retained.

Reference ↗

Open lab →

Definition and overview
Base16 is hexadecimal encoding representing binary data with the characters 0–9 and A–F. Source document ↗
Classification and reversibility
Reversible Base16 encoding, not encryption; no confidentiality. Source document ↗
Key or secret requirements
No key or secret required. Source document ↗
Operating principle and structure
Split binary into 4-bit groups, map each to one of 16 symbols. Source document ↗
Key size, block size and parameters
No fixed key/block size in algorithm registry. Source document ↗
Security strength and recommendation
No security strength; cannot protect confidentiality. Source document ↗
Known attacks and vulnerabilities
Beware implementation attacks such as buffer overflows. Source document ↗
Standards and certification
RFC 4648 defines alphabet and byte-to-character mapping. Source document ↗
Typical uses
Hashes, keys and debugging where byte boundaries matter. Source document ↗
Implementations, libraries and tools
Go standard encoding/hex and other implementations. Source document ↗
Decryption or decoding
Map each hex character to 4 bits and combine; handle case, odd length and nonhex errors. Source document ↗
Advantages
Two characters per byte gives clear boundaries without delimiters. Source document ↗
Limitations and cautions
Output doubles input size. Source document ↗
Distinguishing encryption, encoding and hashing
Base16 is not encryption and cannot conceal passwords or sensitive information. Source document ↗

Practical examples

Examples are illustrative; they are not execution-tested implementations or operational recommendations.

Example

Byte 0x41 splits into 0100/0001 and becomes '41'; decoding restores 0x41.

Procedure

Encode each 4-bit group as 0–9/A–F. Decode pairs of nibbles into bytes, reject odd length/nonhex. Anyone can reverse without key.

Scenario

Show byte boundaries in hashes, fingerprints and debugging logs; represent binary in JSON/URL text channels, but secure confidentiality separately.

Pitfalls and alternatives

Do not conceal passwords with Base16; use TLS, AES or hashing according to purpose. Consider Base64 for bulk data due to 2× size.

References