Palindrome Number Generator
Generate palindrome numbers with configurable digit count, base (decimal, binary, octal, hexadecimal), and quantity.
Input
Output
Readme
What is a palindrome number?
A palindrome number reads the same forwards and backwards. For example, 12321 and 9009 are decimal palindromes, while 10101 is a palindrome in binary. The property is purely positional — it depends entirely on the sequence of digits, not on the numeric value itself.
Palindrome numbers appear across mathematics, computer science, and recreational number theory. They are used in puzzle generation, data validation, and algorithm design (for example, testing string or integer reversal routines). The concept extends naturally to any numeric base: a number that is not a palindrome in base 10 may well be one in base 2 or base 16.
Tool description
This tool generates random palindrome numbers according to the options you choose. You can control the length in digits, how many palindromes to produce in one batch, and which numeric base to use (decimal, binary, octal, or hexadecimal). The output is a plain list you can copy or download for immediate use in tests, puzzles, or educational exercises.
Examples
Decimal, 5 digits, count 5
34543
70807
12321
98789
56765Features
- Configurable digit count — choose any length from 1 to 20 digits.
- Batch generation — produce up to 500 palindromes in a single click.
- Multiple bases — generate palindromes in decimal, binary (base 2), octal (base 8), or hexadecimal (base 16).
- Base prefix toggle — optionally prepend
0b,0o, or0xfor direct use in source code. - Uppercase hex — switch hexadecimal letters between lowercase (
a–f) and uppercase (A–F).
Use cases
- Unit testing — generate a batch of known palindromes to feed into reversal, parsing, or validation functions during automated testing.
- Math education — create problem sets where students must identify or verify palindromic properties across different number bases.
- Puzzle and game design — quickly produce a pool of palindromes for number puzzles, trivia questions, or level-generation seeds.
How it works
For a palindrome of n digits in base b, the first ⌈n/2⌉ digits are chosen at random (with the leading digit forced to be non-zero). The second half is the mirror of the first, ensuring the full sequence reads the same in both directions. This guarantees every generated number is a true palindrome while keeping the distribution uniform within the valid range.
Tips
- Odd vs even digit count — odd-length palindromes (e.g., 5 digits:
12321) have a free middle digit; even-length ones (e.g., 4 digits:1221) are fully symmetric. Both are supported. - Using output in code — enable the base prefix option so the values (e.g.,
0b10101) can be pasted directly into Python, JavaScript, or C source files without modification. - Large batches — set count to 500 and use the download button to save the full list as a
.txtfile for offline use.