Skip to main content

Number / Byte Formatter

Byte formatter: convert bytes to KB, MB and GB in decimal or binary units and format numbers for any locale. Runs in your browser.

Sizes

  • KiB1,024
  • MiB1
  • GiB0.001
  • TiB0

Formatted number

  • en-US1,234,567,890

Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)

Online Number and Byte Formatter

Convert byte counts into readable units and format large numbers with the locale conventions you choose. It helps developers display storage values and large counts clearly in dashboards, logs, and user-facing interfaces.

What this tool does and who uses it

This tool has two independent halves: converting a raw byte count into readable units, either binary (KiB/MiB/GiB/TiB) or decimal (KB/MB/GB/TB), and adding locale-aware grouping separators to a large number. Two concrete uses: a developer sanity-checking that a reported file size or memory value in an API response matches the human-readable number a user would expect, and a frontend developer previewing how a large number will actually display for users in a specific locale (a German user expects 1.234.567.890, not 1,234,567,890) before shipping it.

Worked example

1048576 bytes (exactly 220) converts in binary units to 1,024 KiB, exactly 1 MiB and 0.0009765625 GiB. Switch to decimal units and the same bytes are 1,048.576 KB and 1.0486 MB, because there 1 KB is 1000 bytes. Formatting 1234567890 shows 1,234,567,890 in en-US, 1.234.567.890 in de-DE, and 1,23,45,67,890 in hi-IN — the Indian numbering system groups by 2 digits after the first 3, not 3 digits throughout.

Common mistakes and edge cases

  • KB and KiB are different sizes: 1 KB is 1000 bytes and 1 KiB is 1024 bytes. Storage makers and network speeds use the decimal names, memory and many file managers use the binary ones, so compare like with like. The gap grows with size, about 7% at GB.
  • A locale that's syntactically malformed (like de_DE with an underscore instead of a hyphen) is caught and shown as "Invalid locale." A locale that's syntactically valid but doesn't correspond to anything real (like a made-up xx-YY) is reported as "Unknown locale" instead of quietly using your browser's default, so a typo does not go unnoticed.
  • A negative or non-numeric byte count shows an error message instead of sizes.

Frequently asked questions

Are byte units decimal or binary?
Both, your choice. Binary (the default) uses 1024 and the names KiB, MiB, GiB and TiB, as memory and many file managers do. Decimal uses 1000 and the names KB, MB, GB and TB, as storage makers and network speeds do. Switch with the Unit system menu.
Which locales are supported?
Any locale supported by your browser Intl implementation can be entered, such as en-US, de-DE, hi-IN, or ja-JP.
Is formatting performed remotely?
No. Conversion and Intl.NumberFormat formatting happen locally with JavaScript.
What happens if I type a locale that doesn’t exist, like "xx-YY"?
It depends on the exact string. A syntactically malformed tag (like de_DE with an underscore) throws and shows "Invalid locale." A syntactically valid but nonexistent tag (like a made-up "xx-YY") does not error at all — it silently falls back to your browser’s default locale, so a typo can go unnoticed unless you check the output carefully.
Should I use KB or KiB for file sizes?
KB means 1,000 bytes and KiB means 1,024 bytes. Storage makers and most network speeds use 1,000, while operating systems often show 1,024 and still call it KB. Use the decimal/binary switch on this page and write the unit that matches, so a 500 GB disk is not reported as 465 GB by mistake.

Related tools

More Code & Conversion

View all Code & Conversion tools →