Unit
All examples use BASE_URL — set it to your deployment URL.
POST/api/bytes/convert
Convert a value between byte units. Use mode: "binary" (1024) or "si" (1000).
const res = await fetch(`${BASE_URL}/api/bytes/convert`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ value: 1, unit: "GB", mode: "binary" })
});
// → { success: true, B: 1073741824, KB: 1048576, MB: 1024, GB: 1, TB: 0.000977, PB: 0.00000095 }