XL
    L
    XS
    M
    S
    XXL
    ← All articles
    Shopify how-to June 13, 2026 3 min read

    How to Add cm/inch Unit Switch to Size Charts in Shopify

    Toggle metric/imperial in size charts. App-included or custom JS.

    App Method

    Tailor Size Guide ships with cm/inch toggle. No setup — just enable in chart settings.

    Custom JS Method

    <button onclick="toggleUnit()">cm / in</button>
    <script>
    function toggleUnit(){
      document.querySelectorAll('[data-cm]').forEach(el=>{
        const cm = parseFloat(el.dataset.cm);
        el.textContent = el.dataset.unit==='in' ? cm+' cm' : (cm/2.54).toFixed(1)+' in';
        el.dataset.unit = el.dataset.unit==='in' ? 'cm' : 'in';
      });
    }
    </script>

    FAQs

    Cm/inch toggle?

    App or custom JS.

    Why both units?

    Half your audience prefers cm; half prefer inches.

    Built-in unit toggle

    Tailor Size Guide includes cm/inch toggle out of the box.