{"id":1749,"date":"2026-07-15T16:23:20","date_gmt":"2026-07-15T10:53:20","guid":{"rendered":"https:\/\/nivohost.com\/blog\/?page_id=1749"},"modified":"2026-07-15T16:23:22","modified_gmt":"2026-07-15T10:53:22","slug":"mb-to-gb-converter","status":"publish","type":"page","link":"https:\/\/nivohost.com\/blog\/mb-to-gb-converter\/","title":{"rendered":"MB to GB Converter"},"content":{"rendered":"\n<style data-wp-block-html=\"css\">\n:root{\n    --bg: #F6F5F1;\n    --card: #FFFFFF;\n    --ink: #16171A;\n    --ink-soft: #6C6E76;\n    --ink-faint: #A2A4AC;\n    --line: #E7E5DE;\n    --accent: #0E6B57;\n    --accent-soft: #E4F1EC;\n    --accent-deep: #084C3E;\n    --ad-bg: #EFEDE6;\n    --warn: #C77E14;\n    --danger: #C0392B;\n    --radius: 16px;\n    --shadow: 0 1px 2px rgba(20,20,20,0.04), 0 8px 24px rgba(20,20,20,0.05);\n  }\n\n  html[data-theme=\"dark\"]{\n    --bg: #131417;\n    --card: #1B1D21;\n    --ink: #F3F3F1;\n    --ink-soft: #A0A2AA;\n    --ink-faint: #6C6E76;\n    --line: #2C2E33;\n    --accent: #2FBF95;\n    --accent-soft: #16352C;\n    --accent-deep: #2FBF95;\n    --ad-bg: #202226;\n    --warn: #E5A83E;\n    --danger: #E77066;\n    --shadow: 0 1px 2px rgba(0,0,0,0.2), 0 8px 24px rgba(0,0,0,0.35);\n  }\n\n  html[data-theme=\"dark\"] .toggle-thumb{ background: var(--accent); }\n  html[data-theme=\"dark\"] .toggle button.active{ color: #0B120F; }\n  html[data-theme=\"dark\"] .brand .mark{ background: var(--accent); color: #0B120F; }\n  html[data-theme=\"dark\"] .gen-btn{ color: #0B120F; }\n  html[data-theme=\"dark\"] .chip.on .box::after{ border-color: #0B120F; }\n  html[data-theme=\"dark\"] .seg button.active{ color: #0B120F; }\n  html[data-theme=\"dark\"] .swap-btn svg{ stroke: #0B120F; }\n  html[data-theme=\"dark\"] .swap-btn{ background: var(--accent); }\n\n  *{ box-sizing: border-box; }\n  html{ color-scheme: light; }\n  html[data-theme=\"dark\"]{ color-scheme: dark; }\n\n  body{\n    margin:0;\n    min-height:100vh;\n    background: var(--bg);\n    transition: background 0.2s ease, color 0.2s ease;\n    background-image: radial-gradient(circle at 1px 1px, rgba(20,20,20,0.05) 1px, transparent 0);\n    background-size: 22px 22px;\n    font-family: 'Inter', -apple-system, sans-serif;\n    color: var(--ink);\n    padding: 40px 16px 64px;\n  }\n\n  .page{ width: 100%; max-width: 760px; margin: 0 auto; }\n  .wrap{ width:100%; max-width: 560px; margin: 0 auto; }\n\n  .header{ text-align: center; max-width: 600px; margin: 0 auto 28px; }\n  .eyebrow{\n    font-size: 12px; font-weight: 600; letter-spacing: 0.08em;\n    text-transform: uppercase; color: var(--accent); margin: 0 0 10px;\n  }\n  h1{\n    font-family: 'Inter Tight', 'Inter', sans-serif;\n    font-size: 32px; font-weight: 700; letter-spacing: -0.01em;\n    margin: 0 0 12px; color: var(--ink);\n  }\n  .lede{ font-size: 15px; line-height: 1.6; color: var(--ink-soft); margin: 0; }\n\n  .ad-slot{ max-width: 560px; margin: 0 auto 28px; text-align: center; }\n  .ad-slot .ad-label{\n    font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em;\n    text-transform: uppercase; color: var(--ink-faint); margin: 0 0 6px;\n  }\n  .ad-slot .ad-box{\n    background: var(--ad-bg); border: 1px dashed var(--line); border-radius: 10px;\n    min-height: 90px; display:flex; align-items:center; justify-content:center;\n    font-size: 12px; color: var(--ink-faint);\n  }\n  .ad-slot.rectangle{ max-width: 300px; }\n  .ad-slot.rectangle .ad-box{ min-height: 250px; }\n\n  .card{\n    background: var(--card); border: 1px solid var(--line);\n    border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px;\n  }\n\n  .seg{\n    position: relative; display: grid; background: var(--bg);\n    border: 1px solid var(--line); border-radius: 999px; padding: 4px;\n  }\n  .seg[data-n=\"2\"]{ grid-template-columns: 1fr 1fr; }\n  .seg-thumb{\n    position: absolute; top: 4px; left: 4px; height: calc(100% - 8px);\n    background: var(--ink); border-radius: 999px;\n    transition: transform 0.28s cubic-bezier(.4,0,.2,1), width 0.28s cubic-bezier(.4,0,.2,1);\n  }\n  .seg button{\n    position: relative; z-index: 1; border: none; background: transparent;\n    padding: 10px 8px; font-family: inherit; font-size: 13px; font-weight: 600;\n    color: var(--ink-soft); cursor: pointer; border-radius: 999px; transition: color 0.2s ease;\n  }\n  .seg button.active{ color: #fff; }\n\n  .field{ margin-bottom: 18px; }\n  .field label{\n    display:block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 8px;\n  }\n  .field .hint{ font-size: 11.5px; color: var(--ink-faint); margin-top: 6px; }\n\n  \/* Converter rows *\/\n  .convert-grid{\n    display:grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end;\n    margin-bottom: 6px;\n  }\n  .convert-col label{ font-size: 11.5px; font-weight: 600; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; display:block; }\n\n  .value-input{\n    display:flex; align-items:center; height: 48px;\n    border: 1.5px solid var(--line); background: var(--bg); border-radius: 10px;\n    padding: 0 12px; transition: border-color 0.15s ease; margin-bottom: 8px;\n  }\n  .value-input:focus-within{ border-color: var(--accent); }\n  .value-input input{\n    flex: 1; min-width: 0; width: 100%; height: 100%; border: none; background: transparent; outline: none;\n    font-family: 'JetBrains Mono', monospace; font-size: 17px; font-weight: 600;\n    color: var(--ink); padding: 0 6px; line-height: normal;\n  }\n  .value-input input::-webkit-outer-spin-button,\n  .value-input input::-webkit-inner-spin-button{ -webkit-appearance: none; margin: 0; }\n  .value-input input[type=\"number\"]{ -moz-appearance: textfield; }\n\n  select.sel{\n    width: 100%; border: 1.5px solid var(--line); background: var(--bg);\n    border-radius: 10px; padding: 12px; font-family: inherit; font-size: 13.5px;\n    font-weight: 600; color: var(--ink); outline: none; cursor: pointer;\n  }\n  select.sel:focus{ border-color: var(--accent); }\n\n  .swap-btn{\n    width: 48px; height: 48px; border-radius: 50%; border: none;\n    background: var(--accent-deep); color: #fff; cursor: pointer;\n    display:flex; align-items:center; justify-content:center; flex-shrink: 0;\n    margin-bottom: 8px; transition: transform 0.2s ease, opacity 0.15s ease;\n  }\n  .swap-btn:hover{ opacity: 0.9; }\n  .swap-btn.spin{ transform: rotate(180deg); }\n  .swap-btn svg{ width: 17px; height: 17px; stroke: currentColor; }\n\n  .result-line{\n    display:flex; align-items:baseline; justify-content: space-between; gap: 10px;\n    background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 12px;\n    padding: 14px 16px; margin: 14px 0 6px;\n  }\n  .result-line .lbl{ font-size: 12.5px; font-weight: 600; color: var(--accent-deep); text-transform: uppercase; letter-spacing: 0.04em; }\n  .result-line .val{ font-family: 'JetBrains Mono', monospace; font-size: 20px; font-weight: 700; color: var(--accent-deep); word-break: break-all; text-align: right; }\n\n  .standard-row{ display:flex; align-items:center; justify-content: space-between; gap: 12px; margin: 18px 0 4px; flex-wrap: wrap; }\n  .standard-row .lbl{ font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }\n  .standard-row .lbl .sub{ display:block; font-size: 11px; font-weight: 500; color: var(--ink-faint); margin-top: 2px; }\n\n  hr{ border: none; border-top: 1px solid var(--line); margin: 22px 0; }\n\n  .table-toggle{\n    display:flex; align-items:center; justify-content: space-between;\n    padding: 0 2px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--accent-deep);\n    user-select: none;\n  }\n  .table-toggle .arrow{ transition: transform 0.2s ease; }\n  .table-toggle.open .arrow{ transform: rotate(180deg); }\n  .all-units{ max-height: 0; overflow: hidden; transition: max-height 0.25s ease; }\n  .all-units-inner{ padding-top: 12px; }\n  .unit-row{\n    display:flex; align-items:center; justify-content: space-between; gap: 10px;\n    padding: 10px 12px; border-radius: 10px; font-size: 13.5px;\n  }\n  .unit-row:nth-child(odd){ background: var(--bg); }\n  .unit-row .u-name{ color: var(--ink-soft); font-weight: 600; }\n  .unit-row .u-val{ font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--ink); text-align: right; word-break: break-all; }\n  .unit-row.current{ background: var(--accent-soft); }\n  .unit-row.current .u-name, .unit-row.current .u-val{ color: var(--accent-deep); }\n\n  .footnote{ text-align:center; font-size: 12px; color: var(--ink-faint); margin-top: 18px; }\n\n  .section-heading{ text-align:center; max-width: 600px; margin: 56px auto 28px; }\n  .section-heading h2{\n    font-family: 'Inter Tight', 'Inter', sans-serif; font-size: 22px; font-weight: 700;\n    letter-spacing: -0.01em; margin: 0 0 8px;\n  }\n  .section-heading p{ font-size: 14px; line-height: 1.6; color: var(--ink-soft); margin: 0; }\n\n  .features{ display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }\n  .feature{ background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }\n  .feature .icon{ width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); display:flex; align-items:center; justify-content:center; margin-bottom: 12px; }\n  .feature .icon svg{ width: 18px; height: 18px; stroke: var(--accent-deep); }\n  .feature h3{ font-family: 'Inter Tight', sans-serif; font-size: 14.5px; font-weight: 600; margin: 0 0 4px; }\n  .feature p{ font-size: 13px; line-height: 1.55; color: var(--ink-soft); margin: 0; }\n\n  .about{ max-width: 600px; margin: 56px auto 0; }\n  .about h2{ font-family: 'Inter Tight', 'Inter', sans-serif; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 14px; text-align: center; }\n  .about p{ font-size: 14px; line-height: 1.7; color: var(--ink-soft); margin: 0 0 14px; }\n  .about p:last-child{ margin-bottom: 0; }\n\n  .site-header{ max-width: 760px; margin: 0 auto 40px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }\n  .brand{ display:flex; align-items:center; gap: 9px; font-family: 'Inter Tight', sans-serif; font-weight: 700; font-size: 15px; color: var(--ink); text-decoration: none; }\n  .brand .mark{ width: 30px; height: 30px; border-radius: 8px; background: var(--accent-deep); color: #fff; display:flex; align-items:center; justify-content:center; font-family: 'Inter Tight', sans-serif; font-weight: 700; font-size: 13px; flex-shrink: 0; }\n  .site-nav{ display:flex; gap: 22px; }\n  .site-nav a{ font-size: 13.5px; font-weight: 500; color: var(--ink-soft); text-decoration: none; }\n  .site-nav a:hover{ color: var(--ink); }\n  .header-right{ display:flex; align-items:center; gap: 18px; }\n  .theme-toggle{ position: relative; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); cursor: pointer; display:flex; align-items:center; justify-content:center; flex-shrink: 0; transition: border-color 0.15s ease, background 0.2s ease; }\n  .theme-toggle:hover{ border-color: var(--ink-faint); }\n  .theme-toggle svg{ width: 17px; height: 17px; stroke: var(--ink-soft); position: absolute; transition: opacity 0.2s ease, transform 0.3s ease; }\n  .theme-toggle .icon-sun{ opacity: 0; transform: rotate(-40deg) scale(0.6); }\n  .theme-toggle .icon-moon{ opacity: 1; transform: rotate(0) scale(1); }\n  html[data-theme=\"dark\"] .theme-toggle .icon-sun{ opacity: 1; transform: rotate(0) scale(1); }\n  html[data-theme=\"dark\"] .theme-toggle .icon-moon{ opacity: 0; transform: rotate(40deg) scale(0.6); }\n\n  .menu-toggle{ display: none; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); cursor: pointer; align-items: center; justify-content: center; flex-shrink: 0; padding: 0; transition: border-color 0.15s ease; }\n  .menu-toggle:hover{ border-color: var(--ink-faint); }\n  .menu-toggle .bars{ position: relative; width: 16px; height: 12px; }\n  .menu-toggle .bars span{ position: absolute; left: 0; width: 100%; height: 1.5px; background: var(--ink-soft); border-radius: 2px; transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease; }\n  .menu-toggle .bars span:nth-child(1){ top: 0; }\n  .menu-toggle .bars span:nth-child(2){ top: 5px; }\n  .menu-toggle .bars span:nth-child(3){ top: 10px; }\n  .site-header.nav-open .menu-toggle .bars span:nth-child(1){ top: 5px; transform: rotate(45deg); }\n  .site-header.nav-open .menu-toggle .bars span:nth-child(2){ opacity: 0; }\n  .site-header.nav-open .menu-toggle .bars span:nth-child(3){ top: 5px; transform: rotate(-45deg); }\n\n  .faq{ max-width: 600px; margin: 56px auto 0; }\n  .faq-item{ border-bottom: 1px solid var(--line); }\n  .faq-item:first-child{ border-top: 1px solid var(--line); }\n  .faq-q{ width: 100%; display:flex; align-items:center; justify-content: space-between; gap: 16px; background: transparent; border: none; text-align: left; padding: 18px 2px; cursor: pointer; font-family: 'Inter Tight', sans-serif; font-size: 14.5px; font-weight: 600; color: var(--ink); }\n  .faq-q .plus{ flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); position: relative; transition: transform 0.2s ease, background 0.2s ease; }\n  .faq-q .plus::before, .faq-q .plus::after{ content: ''; position: absolute; background: var(--ink-soft); top: 50%; left: 50%; transform: translate(-50%, -50%); }\n  .faq-q .plus::before{ width: 9px; height: 1.5px; }\n  .faq-q .plus::after{ width: 1.5px; height: 9px; transition: opacity 0.2s ease; }\n  .faq-item.open .faq-q .plus{ background: var(--accent-soft); border-color: var(--accent); transform: rotate(180deg); }\n  .faq-item.open .faq-q .plus::after{ opacity: 0; }\n  .faq-a{ max-height: 0; overflow: hidden; transition: max-height 0.25s ease; }\n  .faq-a p{ margin: 0 0 18px; font-size: 13.5px; line-height: 1.65; color: var(--ink-soft); padding-right: 34px; }\n\n  .site-footer{ max-width: 760px; margin: 64px auto 0; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }\n  .site-footer .copy{ font-size: 12.5px; color: var(--ink-faint); }\n  .footer-links{ display:flex; gap: 18px; flex-wrap: wrap; }\n  .footer-links a{ font-size: 12.5px; color: var(--ink-soft); text-decoration: none; }\n  .footer-links a:hover{ color: var(--ink); }\n\n  @media (max-width: 560px){\n    .features{ grid-template-columns: 1fr; }\n    h1{ font-size: 26px; }\n    .convert-grid{ grid-template-columns: 1fr; }\n    .swap-btn{ margin: 0 auto 8px; transform: rotate(90deg); }\n    .swap-btn.spin{ transform: rotate(270deg); }\n  }\n  @media (max-width: 768px){\n    .site-header{ position: relative; }\n    .menu-toggle{ display: flex; }\n    .site-nav{ position: absolute; top: calc(100% + 10px); right: 0; left: auto; flex-direction: column; align-items: stretch; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 200px; padding: 8px; max-height: 0; opacity: 0; overflow: hidden; pointer-events: none; transition: max-height 0.22s ease, opacity 0.18s ease; z-index: 30; }\n    .site-header.nav-open .site-nav{ max-height: 360px; opacity: 1; pointer-events: auto; padding: 8px; }\n    .site-nav a{ padding: 10px 12px; border-radius: 8px; }\n    .site-nav a:hover{ background: var(--bg); color: var(--ink); }\n  }\n  @media (max-width: 480px){\n    body{ padding: 24px 14px 48px; }\n    .card{ padding: 18px; }\n    .ad-slot.rectangle{ max-width: 100%; }\n    .site-footer{ flex-direction: column; align-items: flex-start; }\n    .result-line{ flex-direction: column; align-items: flex-start; }\n    .result-line .val{ text-align: left; }\n  }\n<\/style>\n\n<div class=\"header\" id=\"calculator\">\n    <p class=\"eyebrow\">Tools \u00b7 Data<\/p>\n    <h1>MB to GB Converter<\/h1>\n    <p class=\"lede\">Free Convert MB to GB, GB to MB, or between any data size \u2014 bits, bytes, KB, MB, GB, TB and PB. Switch between binary (1024) and decimal (1000) standards. Calculated instantly in your browser.<\/p>\n  <\/div>\n\n  <div class=\"wrap\">\n    <div class=\"card\">\n\n      <div class=\"field\" style=\"margin-bottom: 20px;\">\n        <label>Standard<\/label>\n        <div class=\"standard-row\" style=\"margin: 0;\">\n          <span class=\"lbl\">\n            <span id=\"standard-label\">Binary (1024)<\/span>\n            <span class=\"sub\" id=\"standard-sub\">What Windows, macOS &amp; Linux use for file sizes<\/span>\n          <\/span>\n          <div class=\"seg\" id=\"standard-seg\" data-n=\"2\" style=\"width: 190px;\">\n            <div class=\"seg-thumb\" id=\"standard-thumb\"><\/div>\n            <button data-standard=\"binary\" class=\"active\" type=\"button\">Binary<\/button>\n            <button data-standard=\"decimal\" type=\"button\">Decimal<\/button>\n          <\/div>\n        <\/div>\n      <\/div>\n\n      <div class=\"convert-grid\">\n        <div class=\"convert-col\">\n          <label for=\"from-unit\">From<\/label>\n          <select class=\"sel\" id=\"from-unit\"><\/select>\n        <\/div>\n        <div><\/div>\n        <div class=\"convert-col\">\n          <label for=\"to-unit\">To<\/label>\n          <select class=\"sel\" id=\"to-unit\"><\/select>\n        <\/div>\n      <\/div>\n\n      <div class=\"convert-grid\" style=\"align-items: center; margin-top: 4px;\">\n        <div class=\"value-input\" style=\"margin-bottom: 0;\">\n          <input type=\"number\" id=\"from-value\" inputmode=\"decimal\" value=\"1\" step=\"any\">\n        <\/div>\n        <button class=\"swap-btn\" id=\"swap-btn\" type=\"button\" aria-label=\"Swap units\" title=\"Swap units\">\n          <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M7 10V4m0 0L4 7m3-3 3 3M17 14v6m0 0 3-3m-3 3-3-3\"><\/path><\/svg>\n        <\/button>\n        <div class=\"value-input\" style=\"margin-bottom: 0; background: var(--accent-soft); border-color: var(--accent);\">\n          <input type=\"text\" id=\"to-value\" readonly=\"\" style=\"color: var(--accent-deep);\">\n        <\/div>\n      <\/div>\n\n      <div class=\"result-line\">\n        <span class=\"lbl\" id=\"result-label\">1 GB equals<\/span>\n        <span class=\"val\" id=\"result-value\">1,024 MB<\/span>\n      <\/div>\n\n      <hr>\n\n      <div class=\"table-toggle\" id=\"table-toggle\">\n        <span>Show value in every unit<\/span>\n        <span class=\"arrow\">\u25be<\/span>\n      <\/div>\n      <div class=\"all-units\" id=\"all-units\">\n        <div class=\"all-units-inner\" id=\"all-units-inner\"><\/div>\n      <\/div>\n\n    <\/div>\n\n    <p class=\"footnote\">Calculated locally in your browser \u2014 nothing is sent or stored anywhere.<\/p>\n  <\/div>\n\n\n<script>\n(function(){\n  \/\/ Units defined by exponent of the base (bits). \"step\" = binary uses 1024, decimal uses 1000, except bit\/byte which are always exact.\n  var UNITS = [\n    { key: 'bit',  label: 'Bit (b)',          bitsPerUnit: 1 },\n    { key: 'byte', label: 'Byte (B)',         bitsPerUnit: 8 },\n    { key: 'kb',   label: 'Kilobyte (KB)',    order: 1 },\n    { key: 'mb',   label: 'Megabyte (MB)',    order: 2 },\n    { key: 'gb',   label: 'Gigabyte (GB)',    order: 3 },\n    { key: 'tb',   label: 'Terabyte (TB)',    order: 4 },\n    { key: 'pb',   label: 'Petabyte (PB)',    order: 5 }\n  ];\n\n  var BINARY_LABELS = { kb: 'Kibibyte (KiB)', mb: 'Mebibyte (MiB)', gb: 'Gibibyte (GiB)', tb: 'Tebibyte (TiB)', pb: 'Pebibyte (PiB)' };\n  var DECIMAL_LABELS = { kb: 'Kilobyte (KB)', mb: 'Megabyte (MB)', gb: 'Gigabyte (GB)', tb: 'Terabyte (TB)', pb: 'Petabyte (PB)' };\n\n  var state = { standard: 'binary' };\n\n  function bitsPerUnit(unitKey){\n    var u = UNITS.filter(function(x){ return x.key === unitKey; })[0];\n    if(u.bitsPerUnit) return u.bitsPerUnit; \/\/ bit \/ byte, always exact\n    var base = state.standard === 'binary' ? 1024 : 1000;\n    return 8 * Math.pow(base, u.order);\n  }\n\n  function labelFor(unitKey){\n    if(unitKey === 'bit') return 'Bit (b)';\n    if(unitKey === 'byte') return 'Byte (B)';\n    return (state.standard === 'binary' ? BINARY_LABELS : DECIMAL_LABELS)[unitKey];\n  }\n  function shortLabelFor(unitKey){\n    if(unitKey === 'bit') return 'bit';\n    if(unitKey === 'byte') return 'B';\n    if(state.standard === 'binary'){\n      return { kb: 'KiB', mb: 'MiB', gb: 'GiB', tb: 'TiB', pb: 'PiB' }[unitKey];\n    }\n    return unitKey.toUpperCase();\n  }\n\n  var fromSelect = document.getElementById('from-unit');\n  var toSelect = document.getElementById('to-unit');\n  var fromValue = document.getElementById('from-value');\n  var toValue = document.getElementById('to-value');\n  var resultLabel = document.getElementById('result-label');\n  var resultValue = document.getElementById('result-value');\n\n  function populateSelects(){\n    var fromPrev = fromSelect.value || 'gb';\n    var toPrev = toSelect.value || 'mb';\n    fromSelect.innerHTML = '';\n    toSelect.innerHTML = '';\n    UNITS.forEach(function(u){\n      var opt1 = document.createElement('option');\n      opt1.value = u.key;\n      opt1.textContent = labelFor(u.key);\n      fromSelect.appendChild(opt1);\n      var opt2 = document.createElement('option');\n      opt2.value = u.key;\n      opt2.textContent = labelFor(u.key);\n      toSelect.appendChild(opt2);\n    });\n    fromSelect.value = fromPrev;\n    toSelect.value = toPrev;\n  }\n\n  function formatNumber(n){\n    if(!isFinite(n)) return '0';\n    if(Math.abs(n) >= 1e15 || (Math.abs(n) > 0 && Math.abs(n) < 1e-9)){\n      return n.toExponential(4);\n    }\n    \/\/ Trim to a sensible number of decimals, then group thousands\n    var decimals = Math.abs(n) >= 1 ? 6 : 10;\n    var fixed = parseFloat(n.toFixed(decimals));\n    return fixed.toLocaleString('en-US', { maximumFractionDigits: decimals });\n  }\n\n  function convert(value, fromKey, toKey){\n    var bits = value * bitsPerUnit(fromKey);\n    return bits \/ bitsPerUnit(toKey);\n  }\n\n  function renderAllUnits(value, fromKey){\n    var container = document.getElementById('all-units-inner');\n    container.innerHTML = '';\n    UNITS.forEach(function(u){\n      var converted = convert(value, fromKey, u.key);\n      var row = document.createElement('div');\n      row.className = 'unit-row' + (u.key === fromKey ? ' current' : '');\n      row.innerHTML = '<span class=\"u-name\">' + labelFor(u.key) + '<\/span><span class=\"u-val\">' + formatNumber(converted) + ' ' + shortLabelFor(u.key) + '<\/span>';\n      container.appendChild(row);\n    });\n  }\n\n  function calculate(){\n    var val = parseFloat(fromValue.value);\n    if(isNaN(val)) val = 0;\n    var fromKey = fromSelect.value;\n    var toKey = toSelect.value;\n    var converted = convert(val, fromKey, toKey);\n\n    toValue.value = formatNumber(converted) + ' ' + shortLabelFor(toKey);\n    resultLabel.textContent = formatNumber(val) + ' ' + shortLabelFor(fromKey) + ' equals';\n    resultValue.textContent = formatNumber(converted) + ' ' + shortLabelFor(toKey);\n\n    renderAllUnits(val, fromKey);\n\n    var tableInner = document.getElementById('all-units');\n    if(tableInner.style.maxHeight && tableInner.style.maxHeight !== '0px'){\n      tableInner.style.maxHeight = document.getElementById('all-units-inner').scrollHeight + 'px';\n    }\n  }\n\n  fromSelect.addEventListener('change', calculate);\n  toSelect.addEventListener('change', calculate);\n  fromValue.addEventListener('input', calculate);\n\n  \/\/ Swap button\n  var swapBtn = document.getElementById('swap-btn');\n  swapBtn.addEventListener('click', function(){\n    swapBtn.classList.add('spin');\n    setTimeout(function(){ swapBtn.classList.remove('spin'); }, 300);\n    var f = fromSelect.value;\n    var t = toSelect.value;\n    fromSelect.value = t;\n    toSelect.value = f;\n    \/\/ Use the current converted value as the new starting value, so swapping is non-destructive\n    var currentVal = parseFloat(fromValue.value) || 0;\n    var newStart = convert(currentVal, f, t);\n    fromValue.value = parseFloat(newStart.toPrecision(10));\n    calculate();\n  });\n\n  \/\/ Standard segmented control\n  var standardSeg = document.getElementById('standard-seg');\n  var standardThumb = document.getElementById('standard-thumb');\n  var standardLabel = document.getElementById('standard-label');\n  var standardSub = document.getElementById('standard-sub');\n  function layoutSeg(seg, thumb, activeBtn){\n    var w = seg.clientWidth;\n    var pad = 4;\n    var n = seg.querySelectorAll('button').length;\n    var btnWidth = (w - pad * 2) \/ n;\n    var idx = Array.prototype.indexOf.call(seg.querySelectorAll('button'), activeBtn);\n    thumb.style.width = btnWidth + 'px';\n    thumb.style.transform = 'translateX(' + (idx * btnWidth) + 'px)';\n  }\n  standardSeg.querySelectorAll('button').forEach(function(btn){\n    btn.addEventListener('click', function(){\n      standardSeg.querySelectorAll('button').forEach(function(b){ b.classList.remove('active'); });\n      btn.classList.add('active');\n      state.standard = btn.getAttribute('data-standard');\n      layoutSeg(standardSeg, standardThumb, btn);\n      standardLabel.textContent = state.standard === 'binary' ? 'Binary (1024)' : 'Decimal (1000)';\n      standardSub.textContent = state.standard === 'binary'\n        ? 'What Windows, macOS & Linux use for file sizes'\n        : 'What drive manufacturers use on packaging';\n      populateSelects();\n      calculate();\n    });\n  });\n\n  \/\/ Bracket-style accordion for the full unit table\n  var tableToggle = document.getElementById('table-toggle');\n  var allUnits = document.getElementById('all-units');\n  tableToggle.addEventListener('click', function(){\n    var isOpen = tableToggle.classList.toggle('open');\n    allUnits.style.maxHeight = isOpen ? document.getElementById('all-units-inner').scrollHeight + 'px' : '0';\n  });\n\n  \/\/ Init\n  populateSelects();\n  fromSelect.value = 'gb';\n  toSelect.value = 'mb';\n  setTimeout(function(){\n    layoutSeg(standardSeg, standardThumb, standardSeg.querySelector('button.active'));\n    calculate();\n  }, 0);\n  window.addEventListener('resize', function(){\n    layoutSeg(standardSeg, standardThumb, standardSeg.querySelector('button.active'));\n  });\n\n  \/\/ Mobile hamburger menu\n  var siteHeader = document.querySelector('.site-header');\n  var menuToggle = document.getElementById('menu-toggle');\n  var siteNav = document.getElementById('site-nav');\n  function closeMenu(){\n    siteHeader.classList.remove('nav-open');\n    menuToggle.setAttribute('aria-expanded', 'false');\n  }\n  function toggleMenu(){\n    var isOpen = siteHeader.classList.toggle('nav-open');\n    menuToggle.setAttribute('aria-expanded', isOpen ? 'true' : 'false');\n  }\n  menuToggle.addEventListener('click', function(e){ e.stopPropagation(); toggleMenu(); });\n  siteNav.querySelectorAll('a').forEach(function(link){ link.addEventListener('click', closeMenu); });\n  document.addEventListener('click', function(e){\n    if(siteHeader.classList.contains('nav-open') && !siteHeader.contains(e.target)){ closeMenu(); }\n  });\n  document.addEventListener('keydown', function(e){ if(e.key === 'Escape'){ closeMenu(); } });\n\n  \/\/ Theme toggle\n  var themeToggle = document.getElementById('theme-toggle');\n  var manualOverride = false;\n  var mql = window.matchMedia ? window.matchMedia('(prefers-color-scheme: dark)') : null;\n  themeToggle.addEventListener('click', function(){\n    manualOverride = true;\n    var current = document.documentElement.getAttribute('data-theme');\n    document.documentElement.setAttribute('data-theme', current === 'dark' ? 'light' : 'dark');\n  });\n  if(mql){\n    var handleSchemeChange = function(e){\n      if(!manualOverride){ document.documentElement.setAttribute('data-theme', e.matches ? 'dark' : 'light'); }\n    };\n    if(mql.addEventListener){ mql.addEventListener('change', handleSchemeChange); }\n    else if(mql.addListener){ mql.addListener(handleSchemeChange); }\n  }\n\n  \/\/ FAQ accordion\n  var faqItems = document.querySelectorAll('.faq-item');\n  faqItems.forEach(function(item){\n    var q = item.querySelector('.faq-q');\n    var a = item.querySelector('.faq-a');\n    q.addEventListener('click', function(){\n      var isOpen = item.classList.contains('open');\n      faqItems.forEach(function(other){\n        other.classList.remove('open');\n        other.querySelector('.faq-a').style.maxHeight = null;\n      });\n      if(!isOpen){\n        item.classList.add('open');\n        a.style.maxHeight = a.scrollHeight + 'px';\n      }\n    });\n  });\n})();\n <\/script>\n\n\n\n<h3 class=\"wp-block-heading has-text-align-center\">About MB to GB Converter<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Data storage has two competing measurement standards, which is why the same amount of storage can show up as two different numbers. The binary standard treats each step as \u00d71,024 (so 1 GB = 1,024 MB), and is what Windows, macOS, and Linux typically use when reporting file and folder sizes. The decimal standard treats each step as \u00d71,000 (so 1 GB = 1,000 MB), and is what storage manufacturers use on packaging for drives, SSDs, and memory cards.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This mismatch is the reason a &#8220;1 TB&#8221; drive shows up as roughly 931 GB in your file explorer \u2014 no storage is missing, it&#8217;s just being counted with a different ruler. To be precise about which one you mean, the International Electrotechnical Commission defines binary units with an &#8220;i&#8221; \u2014 KiB, MiB, GiB, TiB \u2014 while KB, MB, GB, TB technically refer to the decimal standard, even though they&#8217;re often used loosely for either.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use the standard toggle above to match whichever system your comparison needs \u2014 binary for file sizes and memory, decimal for network speeds, marketed drive capacity, or SI-consistent contexts.<\/p>\n\n\n\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"9\" class=\"elementor elementor-9\">\n\t\t\t\t<div class=\"elementor-element elementor-element-1b00358 e-flex e-con-boxed e-con e-parent\" data-id=\"1b00358\" data-element_type=\"container\" data-e-type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t<div class=\"elementor-element elementor-element-7d5a833 e-con-full e-flex e-con e-child\" data-id=\"7d5a833\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-2e96bdb elementor-view-default elementor-widget elementor-widget-icon\" data-id=\"2e96bdb\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"icon.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-icon-wrapper\">\n\t\t\t<div class=\"elementor-icon\">\n\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-fas-server\" viewBox=\"0 0 512 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M480 160H32c-17.673 0-32-14.327-32-32V64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm112 248H32c-17.673 0-32-14.327-32-32v-64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm112 248H32c-17.673 0-32-14.327-32-32v-64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24z\"><\/path><\/svg>\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-25533e8 e-con-full e-flex e-con e-child\" data-id=\"25533e8\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-ced65c1 elementor-widget elementor-widget-heading\" data-id=\"ced65c1\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Get Hosting Only $1\/Month<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-0214c4b e-con-full e-flex e-con e-child\" data-id=\"0214c4b\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-cc622f1 elementor-mobile-align-center elementor-widget elementor-widget-button\" data-id=\"cc622f1\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"button.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-button-wrapper\">\n\t\t\t\t\t<a class=\"elementor-button elementor-button-link elementor-size-sm\" href=\"https:\/\/nivohost.com\/web-hosting\">\n\t\t\t\t\t\t<span class=\"elementor-button-content-wrapper\">\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-button-text\">View Hosting Plans<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/a>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\n\n\n<div id=\"rank-math-faq\" class=\"rank-math-block\">\n<div class=\"rank-math-list \">\n<div id=\"faq-question-1784112187186\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \">How many MB are in a GB?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Using the binary standard (the one most operating systems use for file sizes), 1 GB equals 1,024 MB. Using the decimal standard (the one storage manufacturers use), 1 GB equals 1,000 MB.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1784112234823\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \">Why do my files show a different size than what I bought?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Storage manufacturers advertise capacity using decimal units (1 GB = 1,000,000,000 bytes), while operating systems often display size using binary units (1 GiB = 1,073,741,824 bytes). A 1TB drive can therefore show as roughly 931 GB in your file explorer, even though no storage is missing.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1784112269312\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \">What is the difference between MB and MiB?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>MB (megabyte) technically means 1,000,000 bytes under the decimal standard, while MiB (mebibyte) unambiguously means 1,048,576 bytes under the binary standard. In everyday use, &#8220;MB&#8221; is often used loosely to mean either, which is the root of most storage-size confusion.<\/p>\n\n<\/div>\n<\/div>\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"Tools \u00b7 Data MB to GB Converter Free Convert MB to GB, GB to MB, or between any&hellip;","protected":false},"author":1,"featured_media":1755,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"csco_singular_sidebar":"","csco_page_header_type":"","csco_page_load_nextpost":"","footnotes":""},"class_list":["post-1749","page","type-page","status-publish","has-post-thumbnail","cs-entry"],"_links":{"self":[{"href":"https:\/\/nivohost.com\/blog\/wp-json\/wp\/v2\/pages\/1749","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nivohost.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/nivohost.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/nivohost.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nivohost.com\/blog\/wp-json\/wp\/v2\/comments?post=1749"}],"version-history":[{"count":5,"href":"https:\/\/nivohost.com\/blog\/wp-json\/wp\/v2\/pages\/1749\/revisions"}],"predecessor-version":[{"id":1756,"href":"https:\/\/nivohost.com\/blog\/wp-json\/wp\/v2\/pages\/1749\/revisions\/1756"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nivohost.com\/blog\/wp-json\/wp\/v2\/media\/1755"}],"wp:attachment":[{"href":"https:\/\/nivohost.com\/blog\/wp-json\/wp\/v2\/media?parent=1749"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}