ForHosting KIT · Math

Integer palindrome checker

Check whether a whole number reads the same both ways: 121 and 3443 do, 10 and 123 do not. You also see the digits and their reverse, so the verdict can be checked by eye. Negative numbers never pass, because of the minus sign. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Value
121
You get
Signed
121
Digits
121
Reversed
121

An integer palindrome is a whole number that reads identically from left to right and from right to left. Classic classroom examples include zero, seven, eleven, one hundred twenty-one, three thousand four hundred forty-three, and twelve thousand three hundred twenty-one. Counterexamples include ten, one hundred, one hundred twenty-three, and every negative integer, because the leading minus sign is part of how the number is read and does not match a trailing digit. This checker accepts one integer, extracts its decimal digits with a deterministic half-reversal loop, and returns true or false together with the signed form, the unsigned digit string, and the reversed digits so you can audit the verdict by eye.

What it means for an integer to be a palindrome

Write the integer in ordinary base-ten form, including a leading minus sign when the number is negative. That character string is the reading. The number is a palindrome when the reading equals its own reverse: the first character matches the last, the second matches the second-to-last, and so on.

Single-digit non-negative integers are always palindromes, because a one-character string equals itself. Zero is a palindrome. Eleven, twenty-two, and every other two-digit number whose tens digit equals its units digit are palindromes.

One hundred twenty-one and three thousand four hundred forty-three are the usual textbook three-digit and four-digit examples. Ten is not a palindrome: its reading is one-zero and the reverse is zero-one, which is a different string and would also be a different integer if leading zeros were allowed. One hundred is not a palindrome for the same reason.

Negative one hundred twenty-one is not a palindrome either, even though its absolute value is: the signed reading is minus-one-two-one and the reverse is one-two-one-minus. This page answers a yes-or-no question about one decimal integer. It does not list other bases in which the same integer might become palindromic, and it does not treat a word, a date, or a sentence as the input.

The definition is fixed and deterministic. There is no sampling, no floating-point comparison, and no approximate equality. A non-integer is not classified as false; it is rejected, because the contract is about whole numbers only.

How the input is read and how the half-reversal stays exact

Internally the engine does not convert the number to a string in order to decide the flag. It runs a half-reversal on the non-negative magnitude: while the remaining leading half is still larger than the reversed trailing half, it peels the last digit with remainder-ten and appends it to the reverse. Even-length numbers succeed when the two halves are equal.

Odd-length numbers succeed when the leading half equals the reverse with the middle digit dropped. Numbers that end in zero cannot be palindromes unless the number itself is zero, because a leading zero is never written. Negative inputs skip the loop and return false.

Where a yes-or-no palindrome check earns its keep

Students meet palindromic numbers when they first reverse digits, when they study Lychrel candidates, and when contest problems ask whether a handle, a ticket number, or a generated identifier is symmetric. Teachers can generate answer keys for worksheets without trusting a calculator that silently drops a minus sign or treats ten as a palindrome because it looks at the absolute value.

Developers use the same contract to validate sample data for number-theory libraries, to gate property tests on random integer generators, or to pre-check that a seed is palindromic before a demonstration step that assumes a symmetric digit string. On this page the work runs entirely in your browser.

Pair it with a multi-base palindrome listing when you need every radix that makes n symmetric, with a perfect-square checker when you need membership in n squared, and with prime factorization when you need the prime signature rather than the digit symmetry of the same integer.

Homework and contest classification

Decide whether worksheet integers and contest seeds are decimal palindromes, including the minus-sign rule for negatives, without hand-reversing digits.

Teaching digit reversal

Show students how 121 stays 121 and how 10 becomes 01 while they change the input live in the browser at no cost.

What does the integer palindrome checker cost?

It is free in your browser on this page.

Are negative integers palindromes?

No. The signed decimal reading includes the minus sign, so the reverse of -121 is 121-, which is not the same string.

How is the palindrome test computed?

The engine runs a half-reversal on the non-negative magnitude: it peels trailing decimal digits with remainder ten and compares the reversed half to the remaining leading half. Numbers that end in zero fail unless the number is zero. No floating-point math is used.

What happens if the input is not an integer?

Fractions, empty values, scientific notation, and non-numeric strings are rejected; they are not classified as false palindromes.

Is the algorithm randomized?

No. It uses deterministic integer remainder and division.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/math/miracle

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/math/miracle \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"value":121}'
{
  "value": 121
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "math.miracle",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Non-integers, empty values, leading zeros on multi-digit strings, and scientific notation fail with invalid_input and are never billed. Explore free on this page, or call the API at $0.002 per successful request when grading scripts need a reproducible yes-or-no palindrome answer.

How the input is read and how the half-reversal stays exact

Send a JSON body with one required field, value, which may also arrive under the aliases n, number, or x so forms and query strings can reuse a single contract. The field must be a finite safe integer: a JSON number with no fractional part, or a decimal string with an optional leading plus or minus and no embedded spaces. Exponential notation, hex prefixes, empty strings, and multi-digit strings with leading zeros are rejected so a bad spreadsheet cell does not become a wrong boolean. Missing value fails with invalid_input and a message that names the field. On success the response echoes value as a number, signed as the canonical decimal reading including a minus when needed, is_palindrome as the boolean verdict, digits as the unsigned decimal digit string, reversed as those digits written backwards, and a short formula restating the rule.

Where a yes-or-no palindrome check earns its keep

Data pipelines that normalize catalog codes, invoice suffixes, or puzzle IDs sometimes need a cheap boolean before a downstream formatter that prints the digits in reverse for display. Through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split — free interactive exploration and a priced, identical API — matches the rest of the tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the mathematical result.

Deterministic test fixtures

Generate reproducible true and false palindrome cases for unit tests, property checks, and CI assertions without embedding static digit tables.

Read the full KIT documentation →