Decrement Code Points
Shift every Unicode code point backward by N. Clamps at U+0000, skips surrogates, shows before/after mapping. Free, offline, client-side, instant, secure.
- Runs in your browser
- Nothing uploaded
- Free, no sign-up
Subtract a fixed integer offset from every Unicode code point in your text. The classic Caesar cipher "Ifmmp" − 1 = "Hello". Clamps at U+0000, skips the surrogate gap (U+D800-U+DFFF), and an optional before/after code-point mapping shows each character's old and new value. Switch Direction to Increment to add the offset instead of subtracting.
How to Use Decrement Code Points
- Enter or paste text. Each Unicode code point will be shifted independently.
- Set an offset (positive integer = decrement; negative = increment). The classic Caesar cipher uses 1, ROT13 uses 13.
- Tick Show before/after mapping for an educational view showing each character's old and new code point in
U+XXXXhex and decimal. - Load a sample - the "ZWJ emoji breakage" sample specifically demonstrates how multi-code-point sequences (like 🏳️🌈) lose meaning when each component shifts independently.
- Live preview updates after 100 ms. Ctrl+Enter triggers manually.
- Copy or download
decremented.txt.
Frequently Asked Questions
What’s a Unicode code point?
A unique number assigned to each Unicode character (range: U+0000 to U+10FFFF, about 1.1 million possible values). ‘A’ = U+0041 (decimal 65), ‘B’ = U+0042 (66), ‘é’ = U+00E9 (233), ‘中’ = U+4E2D (20013), ‘🌍’ = U+1F30D (127757). The tool subtracts your offset from each character’s code point. With offset 1: ‘B’ (66) → ‘A’ (65).
What happens when a result is below U+0000?
It’s clamped to U+0000 (NULL character). NOT wrapped (the original FAQ said “may wrap around” – that’s wrong). So ‘A’ (65) − 100 = U+0000, NOT some negative code point or a wraparound to U+10FFFF. The stats card shows how many code points were clamped, which lets you tell when your offset is too large.
What’s the surrogate gap?
Code points U+D800 through U+DFFF are RESERVED for UTF-16 surrogate halves and cannot represent actual characters. If your decrement lands a code point in this range (e.g., starting from U+E000 and subtracting 1 would land at U+DFFF), the tool snaps to U+D7FF (one below the gap) instead. This is necessary because String.fromCodePoint throws RangeError on surrogate values when called with a single code point in that range. The stats card shows how many surrogate-skips happened.
Why do ZWJ emoji like 🏳️🌈 break?
The rainbow flag 🏳️🌈 is FOUR code points joined visually: U+1F3F3 (white flag) + U+FE0F (variation selector) + U+200D (zero-width joiner) + U+1F308 (rainbow). When you decrement each by 1, you get U+1F3F2 (white pennant) + U+FE0E (text variation selector) + U+200C (zero-width NON-joiner) + U+1F307 (sunset). The visual rendering breaks completely – you see 4 separate symbols, not a shifted flag. Same problem for family emoji (👨👩👧👦), professional emoji (👩🏽💻), and combining accents (é as e + ◌́). This is INTENTIONAL behavior – the tool operates on code points by design. If you need grapheme-aware shifting, the math doesn’t really make sense conceptually (what would “shift the whole grapheme by 1” mean?).
How is this different from the cyclic shift tool?
Cyclic shift (iter 415) rotates the ORDER of characters in a string – “ABCDE” shifted left by 2 becomes “CDEAB”. The characters don’t change, just their positions. This tool shifts each character’s code point value by an offset – “ABCDE” with offset 1 becomes “@ABCD” (each one letter earlier). Both have legitimate use cases; pick based on whether you want to rearrange or to substitute.
Can I use this for encryption?
For toy ciphers and pedagogy: yes. Caesar cipher (offset 3 in the alphabet) is literally a code-point decrement on letters. For real encryption: absolutely NOT. Caesar ciphers can be broken by frequency analysis in seconds. The tool offers zero cryptographic strength. For genuine encryption, use AES via the Web Crypto API (crypto.subtle.encrypt). This tool is for: text puzzles, escape rooms, learning about Unicode, demoing simple substitution ciphers in CS classes.
How do I reverse a decrement?
Use the same offset with a NEGATIVE sign here (which becomes an increment), OR use the companion tool “Increment Code Points” with the same positive offset. They’re inverse operations. If you decremented by 5 and then increment by 5: original text restored, UNLESS some characters were clamped (those went to U+0000 and can’t be recovered).
What about negative offsets?
A negative offset becomes an increment. offset = -3 means “shift each code point UP by 3”. Useful for symmetric calculations and undoing decrements without switching tools. The surrogate-skip logic flips correctly (snap to U+E000 instead of U+D7FF when incrementing past the gap).
Is my data secure?
Yes. All shifting happens in your browser using native codePointAt and String.fromCodePoint. Text never leaves your device.
Related Tools
Convert Code Points to Unicode →
Convert Code Points to Unicode (U+XXXX, hex, decimal) to characters - handles emoji, CJK,…
Convert Unicode to Code Points →
Convert Unicode to code points (U+XXXX, HTML/CSS/JS escapes) and back. Per-character breakdown. Free, offline,…
Code Points to UTF-8 Converter Free →
Free online Unicode code points to UTF-8 converter. Shows actual UTF-8 byte sequences per…
Convert UTF-8 to Code Points →
Convert UTF-8 text to Unicode code points in 7 formats (U+, decimal, HTML, CSS,…
Binary to Gray Code Converter →
Convert binary to Gray code (BRGC) - XOR algorithm, bit-width preserved, step-by-step display, BigInt.…
Convert Decimal to Gray Code →
online decimal to Gray code (reflected binary) converter with bit-width, grouping, and step-by-step XOR…
Convert Gray Code to Binary →
Decode Gray code (reflected binary) to standard binary, decimal, or hex. BigInt-safe, per-line errors,…
Convert Gray Code to Decimal →
Decode Gray code (reflected binary) to decimal, binary, or hex using BigInt. Per-line errors,…
Convert Gray Code to Hex →
Decode Gray code (reflected binary) to hex, decimal, or binary. Accepts binary or hex-packed…
Convert Gray Code to Hexadecimal →
Decode binary Gray code bits into hexadecimal, decimal, or standard binary. BigInt-safe, per-line errors,…
Convert Gray Code to Octal →
Decode Gray code (reflected binary) to octal, decimal, binary, or hex. BigInt-safe, per-line errors,…
Convert Hex to Gray Code →
Convert hex to Gray code (reflected binary) with BigInt precision. Handles 32+ bit values…