GeneratePass
MULTI-FORMAT ENCODER

Encoding Utilities

Encode and decode Base64, URL, Hex, Binary, ROT13, and more.

About Encoding

Multiple encoding formats

This tool supports common encoding formats used in web development, cryptography, and data transmission. All conversions happen locally in your browser.

Introduction

Every piece of data in a computer is just bytes — but humans need to read it, systems need to transport it, and developers need to debug it. Encoding utilities bridge this gap by converting between representations: hex for low-level debugging, binary for bitwise analysis, ASCII/Unicode for character inspection, and Base64 for safe transport. This multi-format encoder/decoder is the developer's microscope — it lets you examine data at every level of abstraction, from individual bits to full Unicode code points. When something is broken, the answer is almost always visible if you look at the data in the right format.

What This Tool Does

Why It Matters

Encoding mismatches cause some of the most baffling bugs in software development. A database stores UTF-8 but the API returns Latin-1, garbling accented characters. A binary protocol sends bytes in big-endian order but the client reads little-endian, interpreting data as nonsensical values. A hex string is one character short, causing a checksum failure that blocks an entire deployment. These bugs surface hours or days after the encoding error was introduced, making them expensive to diagnose. A multi-format encoding utility lets you inspect data at the byte level, compare representations side by side, and identify exactly where the encoding chain breaks.

How It Works

Step-by-Step Examples

Example 1: Convert a string to hex, binary, and decimal representations
1

Enter the text: Hello

2

Select 'Hex' encoding to see each character's byte value

3

Select 'Binary' to see the 8-bit binary representation of each byte

4

Compare all three representations to understand how 'Hello' is stored in memory

ResultHex: 48 65 6c 6c 6f | Binary: 01001000 01100101 01101100 01101100 01101111 | Decimal: 72 101 108 108 111
Example 2: Decode a hex string to identify its ASCII content
1

Paste the hex string: 50 72 69 76 61 63 79 20 4d 61 74 74 65 72 73

2

Select 'Hex to Text' conversion mode

3

Click Decode to convert hex bytes back to readable text

4

Observe the decoded output: Privacy Matters

ResultPrivacy Matters — each pair of hex digits maps to an ASCII character

Code Examples

javascriptConvert between hex, binary, decimal, and ASCII
// String to hex
function textToHex(text) {
  return Array.from(new TextEncoder().encode(text))
    .map(b => b.toString(16).padStart(2, '0'))
    .join(' ');
}

// Hex to string
function hexToText(hex) {
  const bytes = hex.replace(/\s/g, '').match(/.{2}/g)
    .map(b => parseInt(b, 16));
  return new TextDecoder().decode(new Uint8Array(bytes));
}

// String to binary (8-bit per char)
function textToBinary(text) {
  return Array.from(new TextEncoder().encode(text))
    .map(b => b.toString(2).padStart(8, '0'))
    .join(' ');
}

// Binary to string
function binaryToText(binary) {
  const bytes = binary.split(' ')
    .map(b => parseInt(b, 2));
  return new TextDecoder().decode(new Uint8Array(bytes));
}

// String to decimal (Unicode code points)
function textToDecimal(text) {
  return Array.from(text)
    .map(c => c.codePointAt(0).toString())
    .join(' ');
}

// Usage
const text = 'Hello';
console.log(textToHex(text));       // 48 65 6c 6c 6f
console.log(textToBinary(text));    // 01001000 01100101 01101100 01101100 01101111
console.log(textToDecimal(text));   // 72 101 108 108 111
console.log(hexToText('48 65 6c 6c 6f')); // Hello
javascriptDetect text encoding from byte patterns
function detectEncoding(bytes) {
  // Check for BOM (Byte Order Mark)
  if (bytes[0] === 0xEF && bytes[1] === 0xBB && bytes[2] === 0xBF) {
    return { encoding: 'UTF-8', bom: true, confidence: 'high' };
  }
  if (bytes[0] === 0xFF && bytes[1] === 0xFE) {
    return { encoding: 'UTF-16 LE', bom: true, confidence: 'high' };
  }
  if (bytes[0] === 0xFE && bytes[1] === 0xFF) {
    return { encoding: 'UTF-16 BE', bom: true, confidence: 'high' };
  }

  // Check for valid UTF-8 sequences
  let isValidUTF8 = true;
  let i = 0;
  while (i < bytes.length) {
    if (bytes[i] <= 0x7F) { i++; continue; }
    if ((bytes[i] & 0xE0) === 0xC0) { i += 2; continue; }
    if ((bytes[i] & 0xF0) === 0xE0) { i += 3; continue; }
    if ((bytes[i] & 0xF8) === 0xF0) { i += 4; continue; }
    isValidUTF8 = false;
    break;
  }

  if (isValidUTF8) {
    return { encoding: 'UTF-8', bom: false, confidence: 'medium' };
  }

  // Check for high bytes in Latin-1 range
  const hasHighBytes = bytes.some(b => b > 127);
  if (hasHighBytes) {
    return { encoding: 'Latin-1 (ISO-8859-1)', bom: false, confidence: 'low' };
  }

  return { encoding: 'ASCII', bom: false, confidence: 'high' };
}

// Usage
const sample = new TextEncoder().encode('Hello, 世界');
console.log(detectEncoding(sample));
// { encoding: 'UTF-8', bom: false, confidence: 'medium' }

Character Encoding Comparison

EncodingBytes per CharCharacter RangeByte OrderUse Case
ASCII10-127 (7-bit)N/AEnglish-only systems, legacy protocols
Latin-1 (ISO-8859-1)10-255 (8-bit)N/AWestern European text, HTTP headers
UTF-81-4Full Unicode (U+0000 to U+10FFFF)N/AWeb, databases, APIs (dominant standard)
UTF-162 or 4Full UnicodeBOM-dependentWindows internals, JavaScript engines
UTF-324Full UnicodeBOM-dependentInternal processing, fixed-width requirements

Number System Conversion Table

DecimalHexBinaryOctalASCII Char
654101000001101A
976101100001141a
483000110000600
32200010000040Space
33210010000141!
1288010000000200€ (in Latin-1)

Benefits

  • Convert between hex, binary, decimal, and ASCII representations for complete byte-level data inspection.
  • Supports UTF-8, UTF-16, UTF-32, ASCII, and Latin-1 encoding detection and conversion.
  • Instant, client-side conversion — no server requests, no data leakage, works fully offline.
  • Side-by-side comparison of multiple representations for debugging encoding mismatches.

Use Cases

01

Debugging character encoding issues in databases, APIs, and file systems where data appears garbled or corrupted.

02

Inspecting binary protocol payloads at the byte level to identify framing, endianness, and field boundary issues.

03

Verifying checksum calculations by comparing hex representations of computed versus expected values.

04

Analyzing network packet captures by converting raw hex dumps to readable text and structured data.

Common Mistakes to Avoid

Assuming all text is UTF-8 — legacy systems may use Latin-1, Windows-1252, or other encodings that produce different byte sequences.

Confusing hex with binary — 0x1F is 31 in decimal, not 1 followed by 1.

Ignoring byte order marks (BOM) — UTF-16 files without BOM can be read as big-endian or little-endian, producing garbage.

Converting between encodings without preserving the original — re-encoding Latin-1 as UTF-8 doubles the byte size for characters above 127.

Security Implications

Encoding utilities reveal the raw byte content of data, which may contain hidden payloads, steganographic data, or non-printable control characters. Binary data in hex format can reveal embedded null bytes (0x00), escape sequences, or Unicode directional characters (U+202E Right-to-Left Override) used in text direction attacks. When displaying decoded content, be aware that Unicode characters can spoof visual appearance — Cyrillic 'а' (U+0430) looks identical to Latin 'a' (U+0061) but encodes differently. Always validate encoding of user-supplied data before processing.

Security Information

Frequently Asked Questions

Fundamentals

What is Data Encoding?

Data encoding is the process of converting data from one format to another using a specific set of rules or schemes. Encoding is essential in computing for representing information in a format that can be safely transmitted, stored, or processed. Unlike encryption, encoding is not meant to hide information, but to ensure it can be correctly interpreted across different systems.

Common encoding formats include Base64 for binary-to-text encoding, URL encoding for safely transmitting data in web addresses, and Hex encoding for representing binary data as hexadecimal strings. Each format serves a specific purpose and has particular use cases where it excels.

Technical Deep Dive

How Different Encoding Formats Work

Base64 converts binary data to ASCII text using 64 printable characters (A-Z, a-z, 0-9, +, /). It is used for embedding images in HTML/CSS, transmitting binary data over text-based protocols like email, and encoding API credentials. The output is approximately 33% larger than the input.

URL Encoding (Percent Encoding) replaces unsafe characters with a percent sign followed by two hexadecimal digits. Spaces become %20, special characters like @ become %40. This ensures URLs remain valid when containing data that would otherwise break the URL structure.

Hexadecimal Encoding represents each byte as two hexadecimal characters (0-9, a-f). It is used in cryptography for displaying hash values, in network protocols for representing MAC addresses, and in debugging for examining binary data.

ROT13 and Caesar Cipher are simple substitution ciphers that shift characters by a fixed amount. ROT13 shifts by 13 positions, while Caesar Cipher allows any shift value. These are used for hiding spoilers in text and basic obfuscation, not for security.

Practical Applications

Real-World Encoding Applications

Web Development: Base64 encoding is used to embed small images directly in CSS (data URIs), reducing HTTP requests. URL encoding is essential for form submissions and API query parameters.

API Authentication: HTTP Basic Authentication uses Base64 to encode "username:password" pairs before sending them in the Authorization header. Many APIs also use hex encoding for tokens and signatures.

Data Transmission: Email attachments (MIME) use Base64 to encode binary files like images and documents into text-safe format for transmission over SMTP.

Cryptographic Analysis: Hex encoding is the standard way to display cryptographic hashes, digital signatures, and encrypted data. Security professionals frequently convert between binary and hex when analyzing system outputs.

Common Pitfalls

Encoding Mistakes to Avoid

Confusing Encoding with Encryption: Base64 is NOT encryption. Anyone can decode Base64 with a simple tool. Never use Base64 to protect sensitive data like passwords or API keys. Use proper encryption (AES, RSA) for data confidentiality.

Double Encoding: Applying URL encoding twice to the same string produces incorrect results. For example, encoding "hello world" gives "hello%20world", but encoding again gives "hello%2520world" (with literal %25 instead of %). Always check if data has already been encoded.

Character Set Issues: Base64 encoding assumes UTF-8 input. Encoding binary data that is not valid UTF-8 can produce incorrect results. Always ensure your input is properly encoded before Base64 conversion.

Using ROT13 for Security: ROT13 is not encryption and provides zero security. It is a trivially reversible transformation used only for hiding spoilers or surprise content, never for protecting sensitive information.

Related Tools

Related Encoding and Hash Tools

Complement your encoding workflow with these tools:

  • URL Encoder — Dedicated URL encoding and decoding tool with advanced options.
  • SHA-256 Generator — Generate cryptographic hashes and view them in hex format.
  • SHA Hash Tools — Multi-algorithm hash generation including SHA-1, SHA-256, SHA-384, and SHA-512.
  • MD5 Generator — Generate MD5 hashes for file integrity verification.
  • Hash Identifier — Identify unknown hash types by analyzing their format and length.

Frequently Asked Questions

Is Base64 encoding the same as encryption?
No. Base64 is a reversible encoding scheme, not encryption. Anyone with the encoded data can decode it without a key. Base64 is used for data format conversion, not for protecting sensitive information. For security, use proper encryption algorithms like AES-256.
Why does Base64 encoding increase data size?
Base64 converts every 3 bytes of binary data into 4 ASCII characters, resulting in approximately 33% size increase. This overhead is the trade-off for being able to represent binary data using only printable text characters, which is necessary for text-based protocols like email and HTTP.
When should I use URL encoding?
Use URL encoding when including special characters in URL query parameters, form data submitted via GET method, or any data that needs to be safely transmitted as part of a URL. Characters like spaces, ampersands, and equals signs must be encoded to prevent them from being interpreted as URL structure.
What is the difference between hex and Base64?
Hex encoding represents each byte as two hexadecimal characters, while Base64 uses 4 characters for every 3 bytes. Hex is more human-readable and commonly used in cryptography, while Base64 is more space-efficient and commonly used for data transmission. Both are notations for representing binary data as text.
Is ROT13 secure for hiding data?
No. ROT13 provides zero security and is trivially reversible. It is only used for hiding spoilers or surprise content in text, like in forums or puzzle games. For actual data protection, use proper encryption algorithms with strong keys.