Percent to fraction converter
40% is 2/5 once 40/100 is divided by its greatest common divisor, 20. Decimal and negative percentages work too, and you see the unreduced fraction beside the simplest one to check the work. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Percent
- 40
- Percent string
- 40
- Numerator
- 2
- Denominator
- 5
- Fraction
- 2/5
This percent to fraction converter takes a percentage value and returns the equivalent fully reduced fraction. The identity is simple and exact: p percent equals p over one hundred, then numerator and denominator are divided by their greatest common divisor so the result is in lowest terms. Classic checks include forty percent becoming two over five, twelve point five percent becoming one over eight, and one hundred percent becoming one over one. The engine is fully deterministic arithmetic with no network calls, no random sampling, and no date-dependent shortcuts, so the same percentage always yields the same fraction string and the same integer numerator and denominator.
What converting a percent to a fraction gives you
A percentage is already a ratio: it measures parts per hundred. Converting percent to a fraction therefore means writing that ratio without the percent sign and simplifying it. Algebraically, p percent is the rational number p divided by one hundred.
When p is an integer, the unreduced form is simply p over one hundred; when p has a finite decimal expansion, the engine first expresses p as an exact rational from its decimal digits, then multiplies the denominator by one hundred. Reduction uses the Euclidean greatest common divisor algorithm so that forty over one hundred collapses to two over five, twenty-five over one hundred collapses to one over four, and twelve point five over one hundred collapses to one over eight.
Where percent-to-fraction fits in study, finance literacy, and software
Students meet percent-to-fraction conversion when a textbook moves from percent notation to ratios, when a contest problem asks for a simplified form of a rate, or when they compare discounts, tax rates, and probability statements written as percentages. Teachers can pre-generate answer keys for modest percentages without trusting opaque calculator apps that silently switch between mixed numbers and improper fractions or drop signs.
Developers call the same contract from scripts to seed deterministic test vectors for gradebook tools, to normalize user-entered percents before chart labels, or to satisfy programming-challenge statements that demand a reduced fraction rather than a rounded decimal. Contest practice often needs a fast, offline source of simplified ratios so solutions can be checked without graphing calculators under time pressure. Product and education tools use the conversion when a learner types a percent and the UI must show a clean numerator slash denominator for flashcards, worksheets, or step helpers.
What you can do with it
Homework and ratio checks
Convert textbook percentages into reduced fractions and verify numerator and denominator before comparing rates or probabilities.
Education and finance literacy tools
Normalize user-entered percents into lowest-terms fractions for flashcards, discount explainers, and interactive lessons.
FAQ
What does the percent to fraction converter cost?
It is free in your browser on this page.
How is the fraction defined?
For a percentage p, the value is p/100. Numerator and denominator are then divided by gcd(|numerator|, denominator) so the fraction is in lowest terms.
What happens if the input is not a number?
Only finite decimal percentages are accepted; letters, empty strings, Infinity, and NaN are errors.
Does 40 mean 40% or 0.40?
It means 40 percent. The tool treats the input as a percentage magnitude, so 40 becomes 2/5, not 2/5 of one.
Are decimal percentages supported?
Yes. Finite decimals such as 12.5 are converted exactly through their digit expansion, then reduced (12.5% → 1/8).
Related tools
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/fmt/percent-fraction \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"percent":40}'const res = await fetch("https://api.kit.forhosting.com/fmt/percent-fraction", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"percent": 40
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/fmt/percent-fraction",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"percent": 40
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/fmt/percent-fraction", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"percent":40}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"percent":40}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/fmt/percent-fraction", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"percent": 40
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "fmt.percent_fraction",
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_abs_percent | 1000000000000 |
max_decimal_places | 12 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
What a percent-to-fraction conversion means and what the response contains
The response returns the parsed percent value, a normalized percent string, the reduced numerator and denominator, a human-readable fraction string such as two slash five, the unreduced numerator and denominator for transparency, the GCD that was applied, a method tag percent_to_fraction, and a short formula reminder. There is no approximate floating CAS path and no random rounding of the fraction itself: the engine either builds exact integer terms inside the supported magnitude and decimal-place limits or rejects the input with invalid_input. Rejected cases include missing percent, non-numeric tokens, Infinity, NaN, magnitudes above the documented ceiling, and strings with more fractional digits than allowed.
How the percentage is read and how the reduced fraction stays reproducible
Numeric inputs are treated as the percentage magnitude itself: forty means forty percent, not zero point four. Zero is valid and returns zero over one. Negative percentages keep the sign on the numerator after reduction, which matches common textbook treatment of signed ratios. Decimal percentages such as twelve point five are converted through an exact digit path rather than opaque binary floating shortcuts alone: the digits become an integer numerator and a power-of-ten scale, then that rational is divided by one hundred and reduced. The preferred field is percent, but aliases percentage, value, p, text, input, and pct are accepted so spreadsheets, query strings, and typed forms can reuse the same contract. String inputs may include an optional trailing percent sign and optional leading plus or minus; embedded spaces inside the number, hex prefixes, letters, and other non-decimal tokens are rejected with a clear invalid_input message so a bad cell does not become a wrong fraction. Intermediate integers must stay inside the safe integer range, and the absolute percentage magnitude is capped so Worker arithmetic cannot overflow into non-reproducible territory. Pair the free browser run on this page with the priced API when you need the identical mathematical result inside an automated pipeline without re-implementing Euclidean reduction yourself.
Where percent-to-fraction fits in study, finance literacy, and software
On this page the work runs entirely in your browser; 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 KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the mathematical result. Pair it with fraction and percent formatters when you need related steps, and with other math endpoints when you are building a small lab of free, deterministic number helpers.
Integration use cases
Deterministic test fixtures
Generate reproducible fraction strings for unit tests, property checks, and CI assertions that must not re-derive GCD by hand.