ForHosting KIT · Unit converters

Byte converter

5 MB is 5000 KB: convert sizes between bytes, kilobytes, megabytes, gigabytes and terabytes using decimal steps of one thousand, and see the size in bytes alongside. Handy for comparing disk labels, downloads and cloud quotas. 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
5
From
MB
To
KB
You get
Result
5,000 KB
Value bytes
5,000,000
Factor
1,000
From exp
2

A byte converter turns a data size written in one storage unit into the equivalent size in another unit so you can compare disk labels, download reports, cloud quotas, and capacity quotes without mixing prefixes by hand. Enter a non-negative magnitude, choose the source unit among bytes, kilobytes, megabytes, gigabytes, and terabytes, and choose the target unit from the same closed set. The solver applies SI decimal powers of one thousand: one kilobyte is one thousand bytes, one megabyte is one million bytes, one gigabyte is one billion bytes, and one terabyte is one trillion bytes. It returns the converted size in the target unit together with the intermediate size in bytes and the exact multiplicative factor. Missing fields, non-finite numbers, and unknown units fail the same way and are not billed.

SI factors: how bytes become kilobytes, megabytes, gigabytes, and terabytes

The International System of Units defines the prefixes kilo, mega, giga, and tera as successive powers of one thousand. Applied to the byte, that means one kilobyte equals one thousand bytes, one megabyte equals one million bytes, one gigabyte equals one billion bytes, and one terabyte equals one trillion bytes.

A byte converter that follows those SI factors is therefore a change of exponent: if the source unit is one thousand to the power p bytes and the target unit is one thousand to the power q bytes, the converted size is the original magnitude times one thousand raised to (p minus q). Bytes sit at exponent zero, kilobytes at one, megabytes at two, gigabytes at three, and terabytes at four.

Converting five megabytes to kilobytes is five times one thousand to the power of (two minus one), which is five thousand kilobytes. Converting two terabytes to gigabytes is two thousand gigabytes. The same identity in the opposite direction shrinks the number: two thousand megabytes is two gigabytes.

Zero maps to zero in every unit. This landing does not mix in kibibytes or other IEC binary prefixes of one thousand twenty-four; those names and factors answer a different search.

Where a dedicated byte converter earns its keep

Support teams convert advertised disk sizes into a single unit before comparing cloud plans, backup jobs, and download folders. Teachers and exam generators need a deterministic oracle that marks a negative size as invalid instead of silently scaling a minus sign. Round-trip checks are easy: five megabytes must become five thousand kilobytes, one gigabyte must become one billion bytes, and one thousand megabytes must become one gigabyte.

Stay inside the absolute range so the product cannot overflow into a non-finite result the solver must reject. This landing is not a binary-prefix hub, not a bits-versus-bytes converter, and not a transfer-rate calculator; prefer it when the input is already a storage size in SI byte units and you only need the size in another SI unit.

Disk and cloud storage quotes

Convert advertised capacities among bytes, KB, MB, GB, and TB so buyers can compare plans, backup jobs, and volume labels in one unit.

Downloads and media asset budgets

Turn file sizes from logs or export reports into megabytes or gigabytes before you plot usage, set quotas, or explain a download to a customer.

Homework and documentation checks

Students and technical writers convert SI storage sizes and verify the exact 1000^n factor against worksheets without mixing in 1024 by accident.

How does the byte converter work?

Send a non-negative value plus source and target units from B, KB, MB, GB, and TB.

Is a kilobyte 1000 bytes or 1024 bytes here?

One thousand bytes. This converter uses SI decimal prefixes only. Kibibytes and other 1024-based IEC names are out of scope on this landing.

Which units can I convert between?

Bytes (B), kilobytes (KB), megabytes (MB), gigabytes (GB), and terabytes (TB).

How many gigabytes are in 2 TB?

2 TB is 2000 GB, because each step down from terabytes to gigabytes multiplies by one thousand. Going the other way shrinks the number: 2000 MB is 2 GB.

How do I compare storage plans listed in different units?

Convert every size into the same unit first, for example gigabytes, and then compare the numbers directly. The result also shows the size in bytes, which gives you a common reference for any plan.

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/conv/byte-converter

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/conv/byte-converter \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"value":5,"from":"MB","to":"KB"}'
{
  "value": 5,
  "from": "MB",
  "to": "KB"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "conv.byte_converter",
  "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.

max_abs_value1000000000000000
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.

Negative sizes fail with invalid_input because a data quantity cannot be less than zero.

Input contract, response shape, and negative-size errors

Canonical ids are B, KB, MB, GB, and TB; the form presents those as a closed list so a human never has to memorize syntax. Absolute values must stay within the published limit of one quadrillion. A negative size is rejected in plain language because a data quantity cannot be negative; that is the contract students, billing scripts, and disk planners all need. POST a JSON body with three required fields. value is the non-negative finite magnitude to convert; aliases size, amount, n, and quantity are accepted so forms and SDKs can use the name that fits the product. from is the source unit and to is the target unit. Word aliases such as bytes, kilobytes, megabytes, gigabytes, and terabytes are accepted on the API. On success the body echoes rounded value, from, and to; sets result and unit to the converted size and its target token; reports value_bytes as the SI size in bytes; reports factor as one thousand to the power of (from_exp minus to_exp); echoes from_exp and to_exp as the integer exponents; and restates the formula string result equals value times one thousand to the power of (from_exp minus to_exp). Failed validation — missing fields, empty strings, non-finite numbers, unknown units, a non-finite converted result, or a negative size — returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item.

Where a dedicated byte converter earns its keep

Engineering notebooks reduce log-file and media-asset sizes to megabytes or gigabytes before they plot usage, and calling a tiny parse endpoint avoids pulling a general unit library for five SI tokens. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when learners deliberately pass a negative size or omit a unit.

What happens if the size is negative?

The task fails with invalid_input. A data size cannot be negative, so the converter does not scale a minus sign and the call is not billed.

What does the byte converter cost?

The browser tool is free. API requests use prepaid balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →