DevTools Logo

Unit Converter

Unit Converter

Length, weight, volume and area — metric ↔ imperial

Conversion

About

Convert between metric and imperial units for length, weight, volume, and area. Enter a value, pick the source and target units, and read the converted result. Everything runs in your browser.

    Examples

    Convert 100 kilometers to miles

    Input
    category: Length
    from: kilometer (100)
    to: mile
    Output
    100 km = 62.137 mi

    Uses the exact 1 km = 1/1.609344 mi definition, so the result is reproducible to the last decimal.

    Convert 5 kilograms to pounds and ounces

    Input
    category: Weight
    from: kilogram (5)
    to: pound, ounce
    Output
    5 kg = 11.023 lb = 176.37 oz

    The same input maps to multiple imperial units at once, useful for shipping forms that mix unit systems.

    About this tool

    Unit Converter translates values across four measurement categories — length, weight, volume, and area — with full coverage of both metric and imperial units. Conversions are bidirectional, so you can enter either side of the pair and read the result in the other.

    All factors come from the standard SI-based definitions, so results match what you would get from NIST SP 811. Conversion runs entirely in your browser; your values never leave your device.

    How to use this tool

    1. Pick a category

      Choose length, weight, volume or area from the category selector to load the supported units.

    2. Enter a value

      Type a number in the From field and pick its unit. The result appears instantly in the To field.

    3. Adjust precision

      Set the number of decimal places shown so the output matches the precision your use case needs.

    Use cases

    Converting between metric and imperial

    Quickly translate a recipe, a measurement, or a data sheet from one unit system to the other without launching a separate calculator.

    Validating internationalized forms

    Confirm that a back-end conversion of a user-entered value matches the expected output before shipping to production.

    Teaching unit conversion

    Show the exact conversion factor in use (e.g. 1 inch = 2.54 cm exactly) so learners see that 'rounded' values are not the underlying numbers.

    Common mistakes

    Mistake:Treating avoirdupois ounces and fluid ounces as the same.

    Fix:They measure different things — weight vs. volume. The category selector picks the right conversion; mixing the two produces nonsense results.

    Mistake:Conflating short tons, long tons, and metric tons.

    Fix:A US short ton is 2000 lb, a long ton is 2240 lb, and a metric ton is 1000 kg. Always check which ton a document refers to before converting.

    Mistake:Rounding intermediate steps.

    Fix:Each conversion carries rounding error. Convert once in the most precise direction, then round only the final displayed value.

    Frequently asked questions

    Which categories and units are supported?

    Length (meter, kilometer, centimeter, millimeter, mile, yard, foot, inch), weight (kilogram, gram, milligram, pound, ounce, ton), volume (liter, milliliter, gallon, quart, pint, cup, fluid ounce), and area (square meter, square kilometer, hectare, acre, square foot, square inch).

    How precise are the conversions?

    Conversions use the standard SI-based factors (NIST SP 811) so results are exact at the IEEE 754 double-precision limit. The displayed decimals are tunable so you can pick the precision you need.

    Can I convert between metric and imperial?

    Yes. Every category includes both metric and imperial units, and conversion is bidirectional — you can enter a value in either unit and read the equivalent in any other.

    Is anything uploaded or stored?

    No. All conversion is done locally in your browser; your values are not transmitted or persisted.

    References & standards

    .env Secret Safety Linter

    Validate .env syntax and spot likely leaked credentials or placeholder secrets.

    .htaccess Generator

    Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth

    2D Fluid Dynamics & Particle Physics Sandbox

    A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.

    AI Function Calling Schema Generator

    Generate function calling JSON schemas from TypeScript interfaces

    Algorithm Arena & Data Structure Visualizer

    Interactive arena for algorithms and data structures: eight sorting algorithms racing on one seeded input, six pathfinding algorithms walking generated mazes, and BST, AVL, Red-Black, B-tree, heap and trie operations replayed step by step with rotations highlighted. Every run shows the Big-O table and the phase-highlighted reference implementation in four languages, and compared values can be played as pitch (sonification) through the shared audio engine. Everything runs client-side; inputs never leave the browser.

    Ansible Playbook Generator

    Build an Ansible playbook — hosts, vars, and tasks with modules — as YAML