Skip to content

units.constants

physical constants with their units, like the speed of light c and gravity’s G

Physical constants, with their units, so they work in calculations with quantities.

Planck’s constant is h_planck, since h is hours, and the electron’s charge is e_charge, since e is 2.718…. Assigning to a name like c hides the constant for the rest of the session.

The constants’ values are from CODATA 2022.

Tags: science

1
# speed of light
2
c299792458 m/s
3
# gravitational constant
4
G6.6743e-11 m^3/kg/s^2
5
# Planck constant
6
h_planck6.62607e-34 J*s
7
# reduced Planck constant
8
hbar1.05457e-34 J*s
9
# Boltzmann constant
10
k_B1.38065e-23 J/K
11
# Avogadro constant
12
N_A6.02214e23 1/mol
13
# gas constant
14
R8.31446 J/mol/K
15
# elementary charge
16
e_charge1.60218e-19 coulomb
17
# electron mass
18
m_e9.10938e-31 kg
19
# proton mass
20
m_p1.67262e-27 kg
21
# standard gravity
22
g09.80665 m/s^2
23
# vacuum permittivity
24
eps08.85419e-12 farad/m
25
# vacuum permeability
26
mu00.00000125664 N/A^2
27
# Stefan-Boltzmann constant
28
sigma5.67037e-8 W/m^2/K^4
29
# fine-structure constant
30
alpha_fs0.00729735
31
# Bohr radius
32
a05.29177e-11 m
33
# Rydberg constant
34
R_inf10973732 1/m
35
# classical electron radius
36
r_e2.81794e-15 m
37
# Thomson cross section
38
sigma_T6.65246e-29 m^2
39
# neutron mass
40
m_n1.67493e-27 kg
41
# muon mass
42
m_mu1.88353e-28 kg
43
# tau mass
44
m_tau3.16754e-27 kg
45
# deuteron mass
46
m_d3.34358e-27 kg
47
# alpha particle mass
48
m_alpha6.64466e-27 kg
49
# atomic mass unit
50
m_u1.66054e-27 kg
51
# W boson mass
52
m_W1.43271e-25 kg
53
# Z boson mass
54
m_Z1.62557e-25 kg
55
# Higgs boson mass
56
m_H2.23189e-25 kg
57
# Coulomb constant
58
k_e8987551786 N*m^2/C^2
59
# Faraday constant
60
faraday96485.3 coulomb/mol
61
# impedance of free space
62
Z0376.73 Ω
63
# Bohr magneton
64
mu_B9.27401e-24 J/T
65
# nuclear magneton
66
mu_N5.05078e-27 J/T
67
# magnetic flux quantum
68
Phi02.06783e-15 Wb
69
# Josephson constant
70
K_J483597848416984 Hz/V
71
# von Klitzing constant
72
R_K25812.8 Ω
73
# conductance quantum
74
cond_quantum0.0000774809 S
75
# Wien displacement constant
76
b_wien0.00289777 m*K
77
# first radiation constant
78
c1_rad3.74177e-16 W*m^2
79
# second radiation constant
80
c2_rad0.0143878 m*K
81
# molar volume of an ideal gas at 0 °C and 1 atm
82
V_m0.022414 m^3/mol
83
# Loschmidt constant
84
n02.68678e25 1/m^3
Example outputCtrl+Enter to run
1
# the energy in 1 kg of mass, E = mc²
2
1 kg * c**2 to J8.98755e16 J
3
# how long sunlight takes to reach Earth
4
1 au / c to min8.31675 min
5
# photon energy of green light
6
h_planck * c / 530 nm to eV2.33932 eV
7
# the weight of 70 kg
8
70 kg * g0686.465 N
Example outputCtrl+Enter to run

Example results generated on 2026-11-04. Ones using now, today or randomness will differ when you run them.