# Data Storage Converter

> Converts digital storage and transfer sizes between bits, bytes, decimal SI multiples (KB = 1000 B, MB, GB, TB, PB), binary IEC multiples (KiB = 1024 B, MiB, GiB, TiB, PiB) and kilobit/megabit/gigabit/terabit.

- Calculator id: `data-storage` · Category: Unit Conversion (`conversion`) · Tool name: `convert_data_storage`
- Canonical page: https://tttkmbb.com/conversion/data-storage · This document: https://tttkmbb.com/conversion/data-storage.md · JSON definition: https://tttkmbb.com/conversion/data-storage.json

## Purpose

Converts digital storage and transfer sizes between bits, bytes, decimal SI multiples (KB = 1000 B, MB, GB, TB, PB), binary IEC multiples (KiB = 1024 B, MiB, GiB, TiB, PiB) and kilobit/megabit/gigabit/terabit.

**Use when:** You need a file, disk or memory size in another unit, e.g. GB to GiB, MB to bits or TB to GB, or want to explain why a '1 TB' drive shows as 931 GiB.

**Do not use when:** You need transfer time from size and bandwidth (use download-time) or a number in binary/hex (use base-converter).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `value` | number |  | required | Amount to convert, expressed in from_unit. |
| `from_unit` | enum: bit \| B \| KB \| MB \| GB \| TB \| PB \| KiB \| MiB \| GiB \| TiB \| PiB \| kbit \| Mbit \| Gbit \| Tbit |  | required | Unit of the input value. Accepted symbols: bit, B, KB, MB, GB, TB, PB, KiB, MiB, GiB, TiB, PiB, kbit, Mbit, Gbit, Tbit; spelled-out names and common abbreviations are accepted too. |
| `to_unit` | enum: bit \| B \| KB \| MB \| GB \| TB \| PB \| KiB \| MiB \| GiB \| TiB \| PiB \| kbit \| Mbit \| Gbit \| Tbit |  | required | Unit to convert into (same symbols as from_unit). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `result` | number |  | Converted value expressed in to_unit (rounded to 6 decimals; see result_text for very small or very large values). |
| `result_text` | string |  | The conversion as text with 6 significant figures, e.g. "5 mi = 8.04672 km". |
| `formula` | string |  | Relation used, e.g. "1 mi = 1.609344 km". |
| `factor` | number |  | Multiplier from from_unit to to_unit (result = value × factor); absent for non-linear conversions. |
| `conversion_table` | object |  | The input value expressed in every supported data storage unit (6 significant figures), keyed by unit symbol. |

## Formula

`result = value × factor, factor = (1 from_unit in B) / (1 to_unit in B)`

KB/MB/GB/TB/PB follow the SI decimal prefixes (powers of 1000, as used by drive manufacturers and IEC 80000-13); KiB/MiB/GiB/TiB/PiB are binary (powers of 1024, as most operating systems report). 1 byte = 8 bits.

## Data Sources

- NIST – Metric (SI) Prefixes — https://www.nist.gov/pml/owm/metric-si-prefixes (standard, retrieved 2026-09-23)
- Wikipedia – Binary prefix (IEC 80000-13 kibi/mebi/gibi) — https://en.wikipedia.org/wiki/Binary_prefix (reference, retrieved 2026-09-23)
- Wikipedia – Conversion of units — https://en.wikipedia.org/wiki/Conversion_of_units (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/data-storage?value=…&from_unit=…&to_unit=…`
- `POST https://tttkmbb.com/api/v1/calculate/data-storage` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/data-storage · OpenAPI operationId `convert_data_storage` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "data-storage", "inputs": {…}}`

## Example

- 1 GB to GiB: inputs `{"value":1,"from_unit":"GB","to_unit":"GiB"}` → `{"result":0.931323,"formula":"1 GB = 0.9313225746 GiB","conversion_table":{"MB":1000,"MiB":953.674,"bit":8000000000}}`
- 500 MB to megabits: inputs `{"value":500,"from_unit":"MB","to_unit":"Mbit"}` → `{"result":4000,"factor":8,"conversion_table":{"GB":0.5,"MiB":476.837}}`

```
GET https://tttkmbb.com/api/v1/calculate/data-storage?value=1&from_unit=GB&to_unit=GiB
```

## Limitations

You need transfer time from size and bandwidth (use download-time) or a number in binary/hex (use base-converter). KB/MB/GB/TB/PB follow the SI decimal prefixes (powers of 1000, as used by drive manufacturers and IEC 80000-13); KiB/MiB/GiB/TiB/PiB are binary (powers of 1024, as most operating systems report). 1 byte = 8 bits. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Is 1 KB 1000 or 1024 bytes?**

Here KB = 1000 bytes (SI) and KiB = 1024 bytes (IEC). Windows labels 1024-byte units as 'KB', which is why a 1 TB (10^12 B) drive shows as 931 GiB.

**How do I enter megabits?**

Use Mbit, kbit, Gbit or Tbit (or 'megabits'). Bandwidth figures such as 100 Mbps are megabits per second; divide by 8 for MB per second.

## Related

- [Download Time Calculator](https://tttkmbb.com/everyday/download-time.md) — Time to transfer a file at a given bandwidth.
- [Number Base Converter](https://tttkmbb.com/math/base-converter.md) — Convert numbers between binary, decimal and hexadecimal.
