npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

clothes-size-converter

v1.0.2

Published

A simple package for converting global clothes sizes EU, UK, US, Asia etc

Readme

clothes-size-converter

CI

A Node.js package for looking up and converting clothing sizes across brands and regions (EU, UK, US, Asia and more).

Author: Morris K. Njuguna
License: ISC


Installation

npm install clothes-size-converter

Current Coverage

| Garment | Genders | Brands | |---------|---------|--------| | Shirts / Tops | Men | Nike, Adidas, H&M, Zara, Levi's | | Shirts / Tops | Women | Nike, Adidas, H&M, Zara, Levi's | | Trousers | Men | Nike, Adidas, H&M, Zara, Levi's | | Trousers | Women | Nike, Adidas, H&M, Zara, Levi's | | Shoes | Men, Women | Nike | | Dresses | Women | Nike, Adidas, H&M, Zara, Levi's |


Usage

const { shirts, trousers, shoes, dresses } = require('clothes-size-converter');

shirts.listBrands('men');
trousers.listSizesForBrand('women', 'Nike');
shirts.listSizesForBrand('men', 'Nike');
trousers.listSizesForBrand('men', 'Nike');
shirts.mapSizeToUS('men', 'Nike', 'L');
trousers.mapSizeToUS('men', 'Nike', 'L');
dresses.mapSizeToUS('women', 'H&M', 'M');
shoes.convertShoeSize('men', 'US', 9, 'EU'); // 42.5

TypeScript

Type definitions ship with the package (index.d.ts); no @types install needed.

import { shirts } from 'clothes-size-converter';

const result = shirts.mapSizeToUS('men', 'Nike', 'L');

// Lookups return an error message string when something is not found,
// so narrow before using the result:
if (typeof result !== 'string') {
  console.log(result[0]);
}

API Reference — Shirts, Trousers, Dresses, Shoes

All measurement values are in centimetres (cm) and represent [min, max] ranges.


listAllData()

Returns the full dataset for all genders.

shirts.listAllData();
trousers.listAllData();
// { men: { Nike: { ... }, Adidas: { ... } }, women: { ... } }

listGenderData(gender)

Returns data for a specific gender.

| Param | Type | Values | |-------|------|--------| | gender | string | "men" | "women" |

shirts.listGenderData("men");
trousers.listGenderData("men");
// { Nike: { XXS: { chest: [72, 80], ... }, ... }, Adidas: { ... } }
//Trousers will not have chest etc, see src/data/[men/women]/trousers.json

listBrands(gender)

Returns an array of available brand names for a gender.

shirts.listBrands("women");
trousers.listBrands("women");
// ["Adidas", "Nike", "H&M", "Zara", "Levi's"]

listSizesForBrand(gender, brand)

Returns all sizes and their measurements for a brand.

shirts.listSizesForBrand("men", "Nike");
trousers.listSizesForBrand("men", "Nike");
// { XXS: { chest: [72, 80], waist: [57, 65], hip: [72, 80] }, XS: { ... }, ... }
//Trousers will not have chest etc, see src/data/[men/women]/trousers.json

listDimensionsForSize(gender, brand, size)

Returns the measurement ranges for a specific size label.

shirts.listDimensionsForSize("women", "Adidas", "M");
trousers.listDimensionsForSize("women", "Adidas", "M");
// { bust: [89, 94], waist: [73, 78], hip: [98, 103] }
//Trousers will not have bust etc, see src/data/[men/women]/trousers.json

listDimensionsForSizeType(gender, brand, size, sizeType?)

Returns one specific measurement for a size, or all measurements if sizeType is omitted.

| Param | Type | Example | |-------|------|---------| | sizeType | string | undefined | "chest", "waist", "hip", "bust", "inseam" |

shirts.listDimensionsForSizeType("men", "Nike", "L", "chest");
// [104, 112]
trousers.listDimensionsForSizeType("men", "Nike", "L", "hip");
// [104, 112]

shirts.listDimensionsForSizeType("men", "Nike", "L");
// { chest: [104, 112], waist: [89, 97], hip: [104, 112] }
trousers.listDimensionsForSizeType("men", "Nike", "L");
// { waist: [89, 97], hip: [104, 112], inseam: [80, 82] }

listSizesFromDimensions(gender, brand, dimensionsArray)

Finds all size labels where the provided measurements fall within range. Useful for converting body measurements into a size recommendation.

dimensionsArray is an array of { [measurementKey]: value } objects.

shirts.listSizesFromDimensions("men", "Nike", [
  { chest: 100 },
  { waist: 84 }
]);
// [{ M: { chest: [96, 104], waist: [81, 89], hip: [96, 104] } }]

mapSizeToUS(gender, brand, size, sizeType?)

Maps a brand's size to the matching US size(s). A US size matches when every measurement the two charts share overlaps (ranges that only touch at an edge don't count). Results are ordered best match first.

| Param | Type | Notes | |-------|------|-------| | size | string | The brand's size label, e.g. "M" or "L-Tall" | | sizeType | string | undefined | Optional. Compare only this measurement, e.g. "chest" |

Returns an array of { [usSize]: dimensions }, an empty array if no US size matches, or an error string if the gender, brand or size isn't found.

shirts.mapSizeToUS("men", "Nike", "L");
// [
//   { XL: { chest: [107, 112], waist: [91, 97], hip: [106, 111] } },
//   { L:  { chest: [102, 107], waist: [86, 91], hip: [101, 106] } }
// ]

Note: The US reference charts are in convertShirt.js. The women's chart is a first pass and the men's chart has a gap between XS and S; both should be verified against a source chart.


Shoes

Shoes share the lookup functions above (listBrands, listSizesForBrand, listSizesFromDimensions, mapSizeToUS, ...) with one difference: brand charts are keyed by EU size (e.g. "42.5") and hold a single measurement, foot_length in cm.

shoes.listDimensionsForSize("men", "Nike", "42");
// { foot_length: [26.25, 26.75] }

shoes.listSizesFromDimensions("men", "Nike", [{ foot_length: 26.5 }]);
// [{ "42": { foot_length: [26.25, 26.75] } }]

shoes.mapSizeToUS("men", "Nike", "42");
// [{ "9": ... }, { "9.5": ... }, { "8.5": ... }]  best match first

convertShoeSize(gender, from, size, to)

Converts between the "EU", "UK", "US" and "Asia" systems (names are case-insensitive). Asia is the CM/JP size, i.e. foot length in cm. Returns the converted size as a number, or an error string.

shoes.convertShoeSize("men", "US", 9, "EU");     // 42.5
shoes.convertShoeSize("women", "UK", 4.5, "US"); // 7
shoes.convertShoeSize("men", "US", 20, "EU");    // "20 not found in US sizes for men"

listSizeChart(gender)

Returns every size in all four systems.

shoes.listSizeChart("men")[0];
// { EU: 38.5, UK: 5, US: 6, Asia: 24 }

Dresses

Dresses are women's only and use bust, waist and hip. They have the same functions as shirts; dresses.listGenderData("men") returns null.

dresses.listBrands("women");
// ["Adidas", "Nike", "H&M", "Zara", "Levi's"]
dresses.listSizesFromDimensions("women", "Adidas", [{ bust: 90 }, { waist: 74 }, { hip: 100 }]);
// [{ M: { bust: [89, 94], waist: [73, 78], hip: [98, 103] } }]

Size Labels

Men's shirts

XXS, XS, S, M, L, XL, XXL, 3XL, 4XL
Tall variants: S-Tall, M-Tall, L-Tall, XL-Tall, XXL-Tall, 3XL-Tall, 4XL-Tall

Women's shirts

2XS, XS, S, M, L, XL, 2XL
Tall variants: S-Tall, M-Tall, L-Tall, XL-Tall, 2XL-Tall

Men's trousers

XS, S, M, L, XL, XXL (Nike); XS, S, M, L, XL, 2XL (Adidas); XS–XXL (H&M); S, M, L, XL (Zara); 30, 32, 34, 36, 38 (Levi's, waist in inches)

Women's trousers

XS, S, M, L, XL, XXL (Nike); XS, S, M, L, XL, 2XL (Adidas); XS–3XL (H&M); XS–XL (Zara); XXS–XL (Levi's)

Dresses

Same labels as women's shirts, without the Tall variants.

Shoes

Brand charts use EU sizes: 38.5–47.5 (men), 35.5–43 (women), in half sizes.

Other brands (shirts)

  • Men: XXS–XXL (H&M), S–XL (Zara), XS–XL (Levi's)
  • Women: XS–3XL (H&M), XS–XL (Zara), XXS–XL (Levi's)

Data Notes

Not every brand publishes every measurement, so some charts have fewer keys than others (mapSizeToUS only compares the measurements both charts share).

  • Zara men's shirts have chest only; men's trousers have waist only.
  • Levi's men's shirts have chest and waist only. Men's trousers use jeans sizes (waist in inches); inseam is [76, 86], the range of lengths 30–34 in, because length is chosen separately from waist.
  • Levi's and Zara women's charts publish a single body measurement per size, so the [min, max] ranges were derived from the midpoints between neighbouring sizes.
  • Levi's men's trouser sizes 30 and 32 were extrapolated from the published 34/36/38 rows.
  • H&M men's charts come from H&M's official men's size guide (https://th.hm.com/pages/size-guide-men, in cm; checked November 2026). H&M sizes each letter across two numbered sizes, so every range spans both (M covers EUR 48-50). Shirts have chest and waist; trousers have waist and low hip. Inside leg is left out: H&M lists one fixed length per size (76.5-81 cm) rather than a body range, and the shorter ones fall below the US reference chart, which would leave XS, S and M with no US match. H&M's regional guides can differ slightly.
  • Dresses reuse the body measurements from each brand's women's shirt chart (the same size guide applies); the US dress chart is the generic US women's alpha chart.
  • Shoes: only Nike is included. Its foot lengths are the published CM sizes ±0.25 cm. The US reference chart assumes one US size is 1/3 inch (0.847 cm), anchored at 24.8 cm for men's size 7 with women's sizes 1.5 higher, so mapSizeToUS can differ by a size or so from a brand's own US label. UK is derived from US (men: US − 1, women: US − 2.5).

These come from brand size guides and third-party aggregators and should be verified against the brands' own charts before relying on them.


Measurement Keys

| Key | Used in | Description | |-----|---------|-------------| | chest | Men's shirts | Chest circumference (cm) | | bust | Women's shirts | Bust circumference (cm) | | waist | All | Waist circumference (cm) | | hip | All | Hip circumference (cm) | | inseam | Trousers | Inside-leg length (cm) | | foot_length | Shoes | Foot length (cm) |


Roadmap

  • [x] Fix and re-enable mapSizeToUS() for cross-region conversion
  • [x] Add top-level index.js entry point
  • [x] Populate men's and women's trouser data
  • [x] Add trouser converter (convertTrouser.js)
  • [x] Add more brands (H&M, Zara, Levi's)
  • [x] Shoe and dress converters
  • [x] TypeScript type definitions
  • [x] Full Jest test suite
  • [x] CI via GitHub Actions

Contributing

Bug reports and pull requests welcome at github.com/MoMalley254/clothes-size-converter.

To run the tests or publish a release, see CONTRIBUTING.md.


License

ISC © Morris K. Njuguna