ForHosting KIT · Health & fitness

Sodium in salt calculator

Turn grams of salt into milligrams of sodium: 5 g of pure table salt, at a sodium share of 0.3934, holds 1967 mg of sodium. Use 0.40 for the rounded teaching value or the figure from your salt's certificate. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Salt mass
5
Sodium mass fraction
0.3934
You get
Mass percent
39.34 mg
Salt mass mg
5,000
Sodium mg
1,967
Sodium g
1.967

Table salt is sold and weighed as a crystal mass, but nutrition labels, daily-value percentages, and hypertension counseling report sodium in milligrams. Those two quantities are not the same substance in different units: only the sodium mass fraction of the salt converts grams of NaCl-rich crystals into milligrams of the ion that public-health targets constrain. Pure sodium chloride is about 0.3934 sodium by mass; send that stoichiometric value, a round 0.40 teaching approximation, or a fraction from a lab certificate. Negative salt mass is rejected as invalid input and is not billed.

Why milligrams of sodium are not grams of salt

Table salt on a kitchen scale is a mass of crystals. Almost all of that mass is sodium chloride, a one-to-one ionic compound of sodium and chloride. Nutrition facts panels, percent daily values, and hypertension counseling talk about sodium in milligrams because that is the ion public-health targets constrain, not the whole crystal.

The conversion is therefore not a unit change of the same substance: one gram of salt is not one thousand milligrams of sodium. The missing piece is the sodium mass fraction, the dimensionless ratio of sodium mass to total salt mass. For chemically pure NaCl the fraction is the atomic mass of sodium divided by the molar mass of NaCl, about 22.99 divided by 58.44, which is 0.3934.

Five grams of pure table salt at 0.3934 therefore contain 1967 milligrams of sodium. A fraction of 0.40 is the round teaching approximation some labels still use; send 0.40 when you want that convention, or 0.3934 when you want the stoichiometric NaCl value. Zero salt mass is a valid weighing of an empty spoon and yields zero milligrams of sodium.

Recipe and meal-logging apps

Convert a weighed gram amount of table salt into milligrams of sodium using the NaCl mass fraction so nutrition logs match label units.

Dietetics and sodium-restriction education

Show clients why a teaspoon of salt is thousands of milligrams of sodium, using 0.3934 for pure NaCl or 0.40 for the round teaching value.

What sodium mass fraction should I use for ordinary table salt?

Chemically pure NaCl is about 0.3934 (22.99/58.44). A round teaching value of 0.40 is also common. Iodized, kosher, and sea salts stay close when they are still mostly NaCl.

What happens if the salt mass is negative?

Salt mass must be a nonnegative number; zero is allowed and yields 0 mg of sodium. Failed validation is not billed.

Can I send a mass percent such as 39.34 instead of a fraction?

Divide the percent by 100 first (39.34% → 0.3934). Values above 1 are rejected.

Why isn't one gram of salt 1000 mg of sodium?

Because salt is sodium chloride, and only part of its mass is sodium. For pure salt that share is 0.3934, the atomic mass of sodium, 22.99, divided by that of sodium chloride, 58.44. The rest is chloride.

Do sea salt and kosher salt contain the same sodium?

Close to it, as long as they are still mostly sodium chloride. Moisture, anticaking agents and other minerals shift the share slightly, which is why you enter the fraction yourself, for example from a lab certificate.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/health/sodium-in-salt

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/health/sodium-in-salt \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"salt_mass":5,"sodium_mass_fraction":0.3934}'
{
  "salt_mass": 5,
  "sodium_mass_fraction": 0.3934
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "health.sodium_in_salt",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

This sodium in salt calculator accepts a nonnegative salt mass in grams and a sodium mass fraction between zero and one, multiplies them, scales by one thousand, and returns milligrams of sodium as deterministic JSON.

Why milligrams of sodium are not grams of salt

Multiply the salt mass in grams by that fraction and then by one thousand to obtain milligrams of sodium: sodium_mg equals salt_mass times sodium_mass_fraction times 1000. Iodized table salt, kosher salt, and many sea salts remain close to this figure when they are still mostly NaCl; moisture, anticaking agents, and other minerals shift the fraction slightly, which is why this endpoint asks you to send the fraction instead of hard-coding a single brand.

Input contract, response shape, and error behaviour

Values above one are rejected because a mass fraction cannot exceed unity—if you have a mass percent such as 39.34, divide by one hundred first and send 0.3934. POST a JSON object with two required finite numbers. salt_mass is the mass of table salt in grams; aliases salt, mass, salt_g, salt_mass_g, and table_salt are accepted. It must be a nonnegative number: zero is allowed and yields zero milligrams of sodium, while a negative mass is rejected with invalid_input naming salt_mass and is not billed. Non-finite values, empty strings, and missing fields fail the same way. sodium_mass_fraction is the unitless sodium mass fraction between zero and one inclusive; aliases mass_fraction, fraction, sodium_fraction, w_na, and w_sodium are accepted. On success the body echoes salt_mass and sodium_mass_fraction, reports mass_percent as the fraction times one hundred, reports salt_mass_mg as the same salt mass in milligrams, returns sodium_mg as the primary result, and also returns sodium_g for callers who prefer grams. unit is always mg, formula restates sodium_mg = salt_mass_g × sodium_mass_fraction × 1000, and method is mass_fraction so clients can branch without sniffing shapes.

Where a sodium-in-salt API earns its keep

Recipe apps, dietitians, and food-service operators constantly convert a pinch, a teaspoon, or a weighed gram of salt into the milligrams of sodium that labels and daily-value math expect. Classroom labs that teach percent composition can send five grams of NaCl with fraction 0.3934 and show 1967 milligrams of sodium, then scale the same identity down to a teaspoon of about six grams. People on physician-directed sodium restriction should follow clinical guidance, because real foods contain sodium from more than table salt. Calling a tiny parse endpoint avoids copying 0.3934 into every client language and then drifting when someone rounds to 0.4. Meal-logging products can store the user's salt_mass and the fraction they chose, recompute sodium_mg here, and pin the JSON in tests because the algorithm never touches a clock, a random generator, or the network. Keep salt_mass within the published isolate safety cap, send fractions in the closed interval from zero to one, and treat the result as a chemical conversion rather than medical advice. Pair this capability with your own food database when you need total dietary sodium; this endpoint only answers how much sodium sits inside a given mass of salt.

Classroom percent-composition labs

Check student work on sodium in NaCl: salt_mass times 0.3934 times 1000 must match the milligrams the stoichiometric fraction predicts.

How do I convert grams of table salt into milligrams of sodium?

Send salt_mass in grams and sodium_mass_fraction between 0 and 1. The API returns sodium_mg = salt_mass × sodium_mass_fraction × 1000. Pure NaCl is about 0.3934.

What does the sodium in salt calculator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →