ForHosting KIT · Science

Quantum number calculator

The numbers 2, 1, 0 and +1/2 describe a valid electron in a 2p orbital, which holds 2 electrons. Enter n, l, ml and ms to check them against the selection rules and get the orbital name, its subshell and its shell capacity. 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
N
2
L
1
Ml
0
Ms
0.5
You get
Orbital
2p
Orbital letter
p
Ms label
+1/2
Allowed electron count
2

Four quantum numbers uniquely label every allowed electron state in a hydrogen-like atom: the principal quantum number n, the azimuthal quantum number l, the magnetic quantum number ml, and the spin magnetic quantum number ms. This quantum number calculator checks those four values against the spectroscopic selection rules, names the orbital, and returns the orbital capacity—the allowed electron count that spatial orbital can hold under the Pauli exclusion principle. Students checking homework, tutors building auto-graders, and notebooks that must reject an illegal l or ml all need one deterministic contract instead of a table copied from a textbook margin.

What the four quantum numbers mean and which combinations are allowed

The four quantum numbers of an electron in a central potential are not independent labels you can pick from four unrelated menus. The principal quantum number n is a positive integer that sets the shell and the energy scale of a hydrogen-like atom. The azimuthal quantum number l, also called the orbital angular momentum quantum number, is an integer from zero through n minus one; it names the subshell and the spectroscopic letter used in orbital notation.

The magnetic quantum number ml is an integer from minus l through plus l and distinguishes the spatial orbitals inside that subshell. The spin magnetic quantum number ms is only plus one half or minus one half, the two projections of electron spin one half along the quantization axis. Together they pick a unique one-electron state.

This calculator enforces those inequalities in that order: n first, then l against n, then ml against l, then ms against the two allowed half-integers. A combination such as n equals two and l equals two is illegal because l cannot reach n, and a magnetic number whose absolute value exceeds l is illegal even when n and l themselves are fine.

The orbital name is n followed by the spectroscopic letter for l, so two and one become 2p, three and two become 3d, and one and zero become 1s. The letters follow the conventional sequence s, p, d, f, g, h, i, k and onward, skipping j. These are the same hydrogen-like selection rules taught in general chemistry and introductory quantum mechanics; they do not encode multi-electron term symbols, total angular momentum J, or relativistic fine structure, which are different models and different searches.

Classroom selection-rule checks

Let students submit n, l, ml, and ms and verify the orbital name plus the allowed electron count, including a clear error when l ≥ n or |ml| > l.

Atomic-structure explainers and notebooks

Embed a live quantum number calculator on a shell-and-subshell article, or convert stored (n, l, ml, ms) tuples into orbital labels and capacities in a lab notebook.

How do I validate quantum numbers n, l, ml, and ms?

Send finite integers n (1–20), l (0 through n−1), and ml (−l through +l), plus ms equal to 0.5 or −0.5.

Why can't l be equal to n?

Because the azimuthal number only runs from zero to n minus one. A principal number of 2 allows l of 0 or 1, so a combination with l equal to 2 is rejected.

How many electrons fit in a subshell or a shell?

Each orbital holds 2, a subshell holds 2(2l+1) and a shell holds 2n². For a 2p state that means 6 electrons in the subshell and 8 in the whole second shell.

How do I enter the spin quantum number?

As plus one half or minus one half, typed as 0.5 or −0.5. Any other value is rejected, because electron spin has only those two projections.

Can it give the electron configuration of an element?

No. It checks one electron state and names its orbital; it never looks up a ground-state configuration from an atomic number. For that, use an electron configuration tool.

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/phys/quantum-number

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/phys/quantum-number \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"n":2,"l":1,"ml":0,"ms":0.5}'
{
  "n": 2,
  "l": 1,
  "ml": 0,
  "ms": 0.5
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "phys.quantum_number",
  "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.

max_n20
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.

An out-of-range quantum number fails with invalid_input and is not billed. Successful API calls cost $0.002; failed validation does not consume balance.

Input contract, orbital capacity, and what happens when a quantum number is illegal

The spin field must be plus one half or minus one half, written as 0.5 or minus 0.5. Selection-rule failures name the offending quantum number and the legal range: n must lie between one and twenty inclusive so spectroscopic letters stay defined, l must satisfy zero through n minus one, and ml must satisfy minus l through plus l. Formula restates the inequalities and the three capacity identities. The engine never looks up a ground-state configuration from atomic number; that search belongs to an electron-configuration tool, not this quantum-number validator. POST a JSON body with four required fields: n, the principal quantum number; l, the azimuthal quantum number; ml, the magnetic quantum number; and ms, the spin projection. Each of n, l, and ml must be a finite integer, arriving as a JSON number or as a strict numeric string. Aliases principal, azimuthal, ell, magnetic, m, m_l, spin, and m_s are accepted so lab notebooks and existing payloads map without renaming the key. Missing fields, empty strings, non-integers, and non-finite tokens fail with invalid_input naming the field and are not billed. On success the body echoes the four numbers, sets valid to true, reports orbital and orbital_letter, labels ms as +1/2 or -1/2, and returns allowed_electron_count equal to the orbital capacity two, because a spatial orbital specified by n, l, and ml holds two electrons of opposite spin under the Pauli principle. The same payload also reports subshell_capacity as two times two l plus one and shell_capacity as two n squared, plus the allowed l list for that n and the allowed ml list for that l, so a grader can show the legal neighbors without a second call.

Where a quantum number calculator earns its keep, and what it costs

Classrooms and tutoring platforms use a quantum number calculator so learners can check whether a stated n, l, ml, ms tuple is legal and how many electrons that orbital, subshell, and shell may hold, without flipping a sign on ml or writing l equal to n by habit. Laboratory notebooks that already store four quantum numbers can convert them into an orbital label and a capacity without a computer-algebra system. Failed validation does not consume balance. Exam generators and LMS plugins need a deterministic oracle that marks an illegal magnetic number as invalid_input instead of silently returning a capacity that a buggy grader might treat as success. Use the on-page tool for a single electron state at the desk; use the API when a grader, CMS plugin, or data pipeline needs the same contract under KIT balance. Do not send an atomic number and expect a ground-state configuration, and do not send spectroscopic term symbols expecting a total-J decoder; this endpoint validates one-electron hydrogen-like quantum numbers and returns orbital, subshell, and shell capacities only. Pin allowed_electron_count in tests, keep n inside the published range, and you get reproducible selection-rule checks for homework, explainers, and edge workers without standing up symbolic physics infrastructure of your own.

Exam generators and LMS auto-grading

Mark quantum-number items with a deterministic oracle that rejects illegal combinations as invalid_input instead of inventing a capacity.

What allowed electron count does the calculator return?

allowed_electron_count is the orbital capacity 2 (Pauli occupancy of the spatial orbital n, l, ml). The same payload also reports subshell_capacity = 2(2l+1) and shell_capacity = 2n².

Why is l = 2 illegal when n = 2?

The azimuthal quantum number must satisfy 0 ≤ l ≤ n−1. For n = 2 the legal values are 0 and 1 (2s and 2p). l = 2 would be a 2d subshell, which hydrogen-like selection rules forbid; the task fails with invalid_input.

Which values of ms are allowed?

Only +1/2 and −1/2, written as the JSON numbers 0.5 and −0.5. Any other spin projection, including ±1, is rejected as invalid_input and is not billed.

What does the quantum number 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 →