Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

conversion-tables

Unit conversion factors, architectural drawing scale factors and fractional inch tables, as plain JSON and CSV. No dependencies, no build step needed to use it, no API to call.

We built Arch Convert with architects and kept running into the same thing: the numbers everyone needs are scattered across PDFs, vendor knowledge bases and pages that stopped being updated in 2003, and half of them are quietly rounded. So the tables came out of the app and into this repo.

What is in here

File Rows What
data/length.json 8 mm through miles, base unit metre
data/area.json 5 square metres, square feet, hectares, acres
data/volume.json 4 cubic metres, cubic feet, cubic yards, litres
data/mass.json 12 grams through long tons, including stone and both hundredweights
data/capacity.json 13 US and imperial fluid ounces, cups, pints, gallons, spoons
data/drawing-scales.json 21 every architectural and engineering scale, with factors
data/fractional-inches.json 64 every sixty-fourth of an inch in millimetres
data/gas-marks.json 11 UK oven gas marks
data/ingredient-densities.json 4 cooking densities in g/mL
data/temperature.json formulas, since temperature does not convert by factor

Same tables in csv/ if you would rather open them in a spreadsheet.

Exact and approximate are kept apart

This is the bit that matters, and it is why the repo is split into two source files.

Exact values are definitions. An inch is 0.0254 m because the 1959 international yard and pound agreement says so, not because somebody measured carefully. Same for the pound at 0.45359237 kg, the US gallon at 3.785411784 L, and the imperial gallon at 4.54609 L. Everything in src/definitions.mjs derives from those four, so an acre comes out at exactly 4046.8564224 m² and a US fluid ounce at exactly 29.5735295625 mL. No rounding, ever.

Approximate values are conventions. A gas mark is an oven dial, not a standard. A cup of flour at 0.53 g/mL depends on whether you scooped or spooned it, and two people in the same kitchen can be 20% apart. Those live in src/approximate.mjs and every generated file carries an exact: true|false flag so you cannot import one thinking it is the other.

If you take one thing from this repo, take that split. Most conversion tables online blur it, which is how a rounded working value ends up in a document that needed the exact one.

Drawing scales, and the 24:25 trap

An architectural scale written 1/4" = 1'-0" has a factor of 48, because twelve inches of building fit into a quarter inch of drawing forty-eight times.

The metric scale sitting next to it in most title blocks is 1:50, and those are not the same scale. They are 4.17% apart. That gap turns up again and again (1:24 and 1:25, 1:96 and 1:100, 1:192 and 1:200, 1:240 and 1:250, 1:1200 and 1:1250) because imperial factors land on multiples of twelve and metric ones on multiples of ten, so the close pairs always reduce to 24:25.

Every row carries a metricNeighbour with the nearest standard metric scale, the gap as a percentage, and a nearMiss flag. nearMiss: true means the two are close enough to be mistaken for each other on a title block, which is the case worth worrying about. nearMiss: false means the nearest metric scale is simply the closest thing on the shelf and nobody would confuse them.

{
  "label": "1/4\" = 1'-0\"",
  "factor": 48,
  "ratio": "1:48",
  "metricNeighbour": { "scale": 50, "differencePercent": 4.1667, "nearMiss": true }
}

Using it

Straight from the files:

import scales from '@fluxcotech/conversion-tables/drawing-scales' with { type: 'json' };
const quarterInch = scales.rows.find(s => s.factor === 48);

Or clone it and read the JSON however you like. There is no runtime, no functions to call, and nothing to keep up to date.

Converting a length yourself is one multiply, since every table has a single base unit:

import length from './data/length.json' with { type: 'json' };
const metres = u => length.rows.find(r => r.id === u).metres;
const feetToMillimetres = ft => (ft * metres('foot')) / metres('millimetre');
feetToMillimetres(8); // 2438.4

Checking it

npm run build   # regenerate data/ and csv/ from src/
npm test        # verify the numbers against relationships that must hold
npm run check   # both

npm test is the point of the repo. It checks that an ounce is exactly a sixteenth of a pound, that an acre is exactly 43,560 square feet, that a US pint is sixteen US fluid ounces and an imperial pint is twenty imperial ones, that every near-miss drawing scale lands on the 24:25 ratio, and about thirty other things. A conversion table nobody checks is a list of plausible numbers.

The generated files are committed, so you never have to run any of this to use the data.

Corrections welcome

If a number is wrong, open an issue with the source that says so and it gets fixed. Regional standards are the likeliest gap: the ingredient densities are the ones we use, the gas marks are UK and commonwealth, and there are metric scales in use somewhere that are not in our list.

Licence

MIT. Use it in anything, commercial included. Attribution is not required but a link back to convert.fluxcotech.com is appreciated.

Maintained by FluxCo Technologies, who also build Arch Convert, the free imperial and metric converter these tables came out of.

About

Exact unit conversion factors, architectural drawing scale factors and fractional inch tables, as JSON and CSV.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages