User Rating 0.0
Total Usage 0 times
Quick Presets
Is this tool helpful?

Your feedback helps us improve.

About

Percentage computation across heterogeneous units is error-prone. Converting 326.25 m against 5 km requires correct normalization to a common base before division. Mixing up 1024-based file size units with 1000-based prefixes produces silently wrong results in storage capacity reports. This tool normalizes six distinct domains - raw numbers, dates, time durations, file sizes, lengths, and mass - to their canonical base units before applying the ratio formula vT × 100. All conversion factors follow SI definitions and common conventions: file sizes use binary prefixes (1 KB = 1024 B), lengths use the international yard-pound agreement (1 yd = 0.9144 m), and months approximate to 30.4167 days from 36512.

Limitation: date calculations assume Gregorian calendar and do not account for leap-second corrections. Time duration tokens use fixed averages for months and years. The tool truncates results to the specified decimal places without banker's rounding. For financial or scientific reporting requiring IEEE 754 compliance, verify edge cases independently.

percentage calculator value to percent unit percentage converter time to percentage filesize percentage date percentage mass percentage length percentage

Formulas

The core operation across all six modes reduces to a single ratio scaled to 100:

P = VT × 100

Where P = percentage result, V = the value (numerator) normalized to base units, and T = the total (denominator) normalized to the same base units. The result is truncated to d decimal places where d defaults to 2.

For the Dates mode, the formula expands to a positional interpolation:

P = ttarget tstarttend tstart × 100

Where ttarget, tstart, and tend are Unix epoch timestamps in milliseconds obtained from JavaScript Date.parse.

For Time durations, the parser tokenizes input strings using the pattern: [value][unit] repeated (e.g., 3h2min30sec) or the colon-separated format HH:MM:SS.ms. Each token is multiplied by its millisecond factor and summed.

For Filesize, binary prefixes are used: 1 KB = 10241 B, 1 MB = 10242 B, and so on through YB at 10248.

Reference Data

DomainUnitSymbolBase UnitConversion Factor
FilesizeByteBB1
FilesizeKilobyteKBB1024
FilesizeMegabyteMBB1,048,576
FilesizeGigabyteGBB1,073,741,824
FilesizeTerabyteTBB1.0995 × 1012
FilesizePetabytePBB1.1259 × 1015
FilesizeExabyteEBB1.1529 × 1018
FilesizeZettabyteZBB1.1806 × 1021
FilesizeYottabyteYBB1.2089 × 1024
LengthMillimetermmm0.001
LengthCentimetercmm0.01
LengthDecimeterdmm0.1
LengthMetermm1
LengthKilometerkmm1000
LengthFootftm0.3048
LengthInchinm0.0254
LengthYardydm0.9144
MassMilligrammgg0.001
MassGramgg1
MassKilogramkgg1000
MassPoundlbg453.592
MassOunceozg28.3495
TimeMillisecondmsms1
TimeSecondsecms1,000
TimeMinuteminms60,000
TimeHourhms3,600,000
TimeDaydms86,400,000
TimeWeekwms604,800,000
TimeMonthmms2,628,000,000
TimeYearyms31,536,000,000

Frequently Asked Questions

This tool follows the convention used in the percentage-js specification: 1 year = 365 days and 1 month = 36512 30.4167 days. For astronomical or financial year calculations requiring 365.25 or 360-day conventions, adjust your input accordingly.
Binary prefixes are used throughout: 1 KB = 1024 B, 1 MB = 1,048,576 B. This matches how operating systems report storage. If your data uses SI decimal prefixes (kB = 1000 B), convert to bytes first and use the Numbers mode.
Division by zero is caught and returns an error toast. The result displays "undefined" since V0 is mathematically undefined. Ensure T 0 for valid output.
Dates are parsed via the browser's native Date constructor, which interprets strings in the local time zone unless an explicit offset is provided (e.g., 2024-06-15T12:00:00Z). DST transitions may cause a ±1 hour discrepancy. For cross-timezone precision, append UTC offsets to your date strings.
Yes. If V > T in numeric, filesize, length, or mass modes, the result exceeds 100%. In date mode, if the target date falls before the start date, the result is negative, indicating the target precedes the range. These are mathematically valid outputs.
The colon format expects HH:MM:SS.ms. Partial inputs like 5:30 are interpreted as 5 hours and 30 minutes. A single number like 120 without colons or unit tokens is treated as 120 hours (the largest non-token unit). Always specify units explicitly if ambiguity is possible.