Precision CNC machining. Ridgeway, South Carolina. info@DmMachinetool.com 803-216-5665
DM Machine and Tool LLC Get It Made Now

Reference charts

10 tools

Tap drills, drill sizes, clearance holes, decimal equivalents, gauges and keys.

Charts

Machining

29 tools

Speeds and feeds, bolt circles, sine bars, weights, threads, tap drills and fits.

Shop math

Shear, bolts and threads

Fits and heat

Geometry

11 tools

Triangles, circles, chords, polygons, areas and volumes.

Geometry and trig

Strength and structures

22 tools

Pressure vessels, beams, shafts, columns, stress, springs, gears and bearings.

Pressure

Beams, shafts and columns

Stress and strain

Machine elements

Physics

29 tools

The energy in light, motion and electricity, and Bernoulli's equation with the rest of the fluid and air tools.

Light and energy

Motion and electricity

Fluids and air

Automotive

14 tools

Two-stroke oil to gas mix, displacement, compression ratio, gearing, tire size and more.

Fuel and mix

Engine and drivetrain

Chemistry

8 tools

Molar mass, the mol calculator, molarity, dilution, balancing and stoichiometry.

Quick starts

Moles and mixes

Reactions

Medical math

25 tools

Dosage math, ECMO flow, and a medication lookup that opens the official label. Math aids only, not medical advice.

Dosage math

ECMO and perfusion

Medication reference

Programming

24 tools

G-code and M-code lists, custom macro commands, and quick references for Python, C and C++, JavaScript, Java, C#, SQL, the command line, Git, HTML and CSS.

G-code and M-code

Python

C and C++

JavaScript, Java and C#

Data, shell and web

Sports

25 tools

Pace and split times, cross country team scoring, the RPE calculator and workout math, and the stats behind a box score.

Running and cross country

Strength and workout

Scores and stats

Conversion

19 tools

Length, area, volume, weight, force and thrust, pressure, torque, energy, power, speed, flow, temperature and more.

Unit converters

Units

Tap drill chart, inch (Unified)

The standard drill nearest 75 percent of full thread for each Unified coarse and fine thread, and the percent of thread that drill really leaves. In tough material a drill one size larger is common.

Show the chart
ThreadSeriesMajor diameter, inTap drillDrill, inDrill, mmThread left
#0-80UNF0.06003/640.04691.1981%
#1-64UNC0.0730#530.05951.5167%
#1-72UNF0.0730#530.05951.5175%
#2-56UNC0.0860#500.07001.7869%
#2-64UNF0.0860#500.07001.7879%
#3-48UNC0.0990#470.07851.9976%
#3-56UNF0.0990#450.08202.0873%
#4-40UNC0.1120#430.08902.2671%
#4-48UNF0.1120#420.09352.3768%
#5-40UNC0.1250#380.10152.5872%
#5-44UNF0.1250#370.10402.6471%
#6-32UNC0.1380#360.10652.7178%
#6-40UNF0.1380#330.11302.8777%
#8-32UNC0.1640#290.13603.4569%
#8-36UNF0.1640#290.13603.4578%
#10-24UNC0.1900#250.14953.8075%
#10-32UNF0.1900#210.15904.0476%
#12-24UNC0.2160#160.17704.5072%
#12-28UNF0.2160#140.18204.6273%
1/4-20UNC0.2500#70.20105.1175%
1/4-28UNF0.2500#30.21305.4180%
5/16-18UNC0.3125F0.25706.5377%
5/16-24UNF0.3125I0.27206.9175%
3/8-16UNC0.37505/160.31257.9477%
3/8-24UNF0.3750Q0.33208.4379%
7/16-14UNC0.4375U0.36809.3575%
7/16-20UNF0.437525/640.39069.9272%
1/2-13UNC0.500027/640.421910.7278%
1/2-20UNF0.500029/640.453111.5172%
9/16-12UNC0.562531/640.484412.3072%
9/16-18UNF0.562533/640.515613.1065%
5/8-11UNC0.625017/320.531313.4979%
5/8-18UNF0.625037/640.578114.6865%
3/4-10UNC0.750021/320.656316.6772%
3/4-16UNF0.750011/160.687517.4677%
7/8-9UNC0.875049/640.765619.4576%
7/8-14UNF0.875013/160.812520.6467%
1-8UNC1.00007/80.875022.2277%
1-12UNF1.000059/640.921923.4272%

Tap drill chart, metric

The usual tap drill for metric coarse and fine threads: the diameter less the pitch, which leaves about three quarters of full thread.

Show the chart
ThreadSeriesPitch, mmTap drill, mmTap drill, in
M1.6 x 0.35coarse0.351.250.0492
M2 x 0.4coarse0.401.600.0630
M2.5 x 0.45coarse0.452.050.0807
M3 x 0.5coarse0.502.500.0984
M4 x 0.7coarse0.703.300.1299
M5 x 0.8coarse0.804.200.1654
M6 x 1coarse1.005.000.1969
M8 x 1.25coarse1.256.750.2657
M8 x 1fine1.007.000.2756
M10 x 1.5coarse1.508.500.3346
M10 x 1.25fine1.258.750.3445
M10 x 1fine1.009.000.3543
M12 x 1.75coarse1.7510.250.4035
M12 x 1.5fine1.5010.500.4134
M12 x 1.25fine1.2510.750.4232
M14 x 2coarse2.0012.000.4724
M14 x 1.5fine1.5012.500.4921
M16 x 2coarse2.0014.000.5512
M16 x 1.5fine1.5014.500.5709
M18 x 2.5coarse2.5015.500.6102
M20 x 2.5coarse2.5017.500.6890
M20 x 1.5fine1.5018.500.7283
M24 x 3coarse3.0021.000.8268

Clearance holes for inch screws

Drill sizes for a screw to pass through. Close fit when parts are located by the screws; free fit for easy assembly.

Show the chart
ScrewScrew diameter, inClose fitFree fit
11.00001-1/64 (1.0156)1-1/32 (1.0313)
#00.0600#52 (0.0635)#50 (0.0700)
#10.0730#48 (0.0760)#46 (0.0810)
#20.0860#43 (0.0890)#41 (0.0960)
#30.0990#37 (0.1040)#35 (0.1100)
#40.1120#32 (0.1160)#30 (0.1285)
#50.1250#30 (0.1285)#29 (0.1360)
#60.1380#27 (0.1440)#25 (0.1495)
#80.1640#18 (0.1695)#16 (0.1770)
#100.1900#9 (0.1960)#7 (0.2010)
#120.2160#2 (0.2210)#1 (0.2280)
1/40.2500F (0.2570)H (0.2660)
5/160.3125P (0.3230)Q (0.3320)
3/80.3750W (0.3860)X (0.3970)
7/160.437529/64 (0.4531)15/32 (0.4688)
1/20.500033/64 (0.5156)17/32 (0.5313)
5/80.625041/64 (0.6406)21/32 (0.6563)
3/40.750049/64 (0.7656)25/32 (0.7813)
7/80.875057/64 (0.8906)29/32 (0.9063)

Clearance holes for metric screws

Medium-fit clearance holes for metric screws.

Show the chart
ScrewClearance hole, mmClearance hole, in
M22.40.0945
M2.52.90.1142
M33.40.1339
M44.50.1772
M55.50.2165
M66.60.2598
M89.00.3543
M1011.00.4331
M1213.50.5315
M1617.50.6890
M2022.00.8661
M2426.01.0236

Counterbores for socket head cap screws

Counterbore diameter and depth to sink the head of a socket head cap screw flush. The head is as tall as the screw's diameter.

Show the chart
ScrewHead diameter, inCounterbore diameterCounterbore depth, in
#40.18307/32 (0.2188)0.1120
#60.22609/32 (0.2813)0.1380
#80.27005/16 (0.3125)0.1640
#100.31203/8 (0.3750)0.1900
1/40.37507/16 (0.4375)0.2500
5/160.469017/32 (0.5313)0.3125
3/80.56205/8 (0.6250)0.3750
1/20.750013/16 (0.8125)0.5000
5/80.93801 (1.0000)0.6250
3/41.12501-3/16 (1.1875)0.7500

Pipe tap drills (NPT)

Tap drills for American taper pipe threads, drilled without reaming.

Show the chart
Pipe sizeThreads per inchTap drillDrill, in
1/1627D0.2460
1/827R0.3390
1/4187/160.4375
3/81837/640.5781
1/21423/320.7188
3/41459/640.9219
111.51-5/321.1563

Drill sizes: number, letter and fraction

Every standard inch drill up to 1/2 inch in order of size, with its decimal and metric size.

Show the chart
DrillKindInchesMillimeters
#80Number0.01350.34
#79Number0.01450.37
1/64Fraction0.01560.40
#78Number0.01600.41
#77Number0.01800.46
#76Number0.02000.51
#75Number0.02100.53
#74Number0.02250.57
#73Number0.02400.61
#72Number0.02500.64
#71Number0.02600.66
#70Number0.02800.71
#69Number0.02920.74
#68Number0.03100.79
1/32Fraction0.03130.79
#67Number0.03200.81
#66Number0.03300.84
#65Number0.03500.89
#64Number0.03600.91
#63Number0.03700.94
#62Number0.03800.97
#61Number0.03900.99
#60Number0.04001.02
#59Number0.04101.04
#58Number0.04201.07
#57Number0.04301.09
#56Number0.04651.18
3/64Fraction0.04691.19
#55Number0.05201.32
#54Number0.05501.40
#53Number0.05951.51
1/16Fraction0.06251.59
#52Number0.06351.61
#51Number0.06701.70
#50Number0.07001.78
#49Number0.07301.85
#48Number0.07601.93
5/64Fraction0.07811.98
#47Number0.07851.99
#46Number0.08102.06
#45Number0.08202.08
#44Number0.08602.18
#43Number0.08902.26
#42Number0.09352.37
3/32Fraction0.09382.38
#41Number0.09602.44
#40Number0.09802.49
#39Number0.09952.53
#38Number0.10152.58
#37Number0.10402.64
#36Number0.10652.71
7/64Fraction0.10942.78
#35Number0.11002.79
#34Number0.11102.82
#33Number0.11302.87
#32Number0.11602.95
#31Number0.12003.05
1/8Fraction0.12503.17
#30Number0.12853.26
#29Number0.13603.45
#28Number0.14053.57
9/64Fraction0.14063.57
#27Number0.14403.66
#26Number0.14703.73
#25Number0.14953.80
#24Number0.15203.86
#23Number0.15403.91
5/32Fraction0.15633.97
#22Number0.15703.99
#21Number0.15904.04
#20Number0.16104.09
#19Number0.16604.22
#18Number0.16954.31
11/64Fraction0.17194.37
#17Number0.17304.39
#16Number0.17704.50
#15Number0.18004.57
#14Number0.18204.62
#13Number0.18504.70
3/16Fraction0.18754.76
#12Number0.18904.80
#11Number0.19104.85
#10Number0.19354.91
#9Number0.19604.98
#8Number0.19905.05
#7Number0.20105.11
13/64Fraction0.20315.16
#6Number0.20405.18
#5Number0.20555.22
#4Number0.20905.31
#3Number0.21305.41
7/32Fraction0.21885.56
#2Number0.22105.61
#1Number0.22805.79
ALetter0.23405.94
15/64Fraction0.23445.95
BLetter0.23806.05
CLetter0.24206.15
DLetter0.24606.25
1/4Fraction0.25006.35
ELetter0.25006.35
FLetter0.25706.53
GLetter0.26106.63
17/64Fraction0.26566.75
HLetter0.26606.76
ILetter0.27206.91
JLetter0.27707.04
KLetter0.28107.14
9/32Fraction0.28137.14
LLetter0.29007.37
MLetter0.29507.49
19/64Fraction0.29697.54
NLetter0.30207.67
5/16Fraction0.31257.94
OLetter0.31608.03
PLetter0.32308.20
21/64Fraction0.32818.33
QLetter0.33208.43
RLetter0.33908.61
11/32Fraction0.34388.73
SLetter0.34808.84
TLetter0.35809.09
23/64Fraction0.35949.13
ULetter0.36809.35
3/8Fraction0.37509.52
VLetter0.37709.58
WLetter0.38609.80
25/64Fraction0.39069.92
XLetter0.397010.08
YLetter0.404010.26
13/32Fraction0.406310.32
ZLetter0.413010.49
27/64Fraction0.421910.72
7/16Fraction0.437511.11
29/64Fraction0.453111.51
15/32Fraction0.468811.91
31/64Fraction0.484412.30
1/2Fraction0.500012.70

Decimal equivalents of fractions

Every 64th of an inch as a decimal and in millimeters.

Show the chart
FractionInchesMillimeters
1/640.0156250.40
1/320.031250.79
3/640.0468751.19
1/160.06251.59
5/640.0781251.98
3/320.093752.38
7/640.1093752.78
1/80.12503.17
9/640.1406253.57
5/320.156253.97
11/640.1718754.37
3/160.18754.76
13/640.2031255.16
7/320.218755.56
15/640.2343755.95
1/40.25006.35
17/640.2656256.75
9/320.281257.14
19/640.2968757.54
5/160.31257.94
21/640.3281258.33
11/320.343758.73
23/640.3593759.13
3/80.37509.52
25/640.3906259.92
13/320.4062510.32
27/640.42187510.72
7/160.437511.11
29/640.45312511.51
15/320.4687511.91
31/640.48437512.30
1/20.500012.70
33/640.51562513.10
17/320.5312513.49
35/640.54687513.89
9/160.562514.29
37/640.57812514.68
19/320.5937515.08
39/640.60937515.48
5/80.625015.88
41/640.64062516.27
21/320.6562516.67
43/640.67187517.07
11/160.687517.46
45/640.70312517.86
23/320.7187518.26
47/640.73437518.65
3/40.750019.05
49/640.76562519.45
25/320.7812519.84
51/640.79687520.24
13/160.812520.64
53/640.82812521.03
27/320.8437521.43
55/640.85937521.83
7/80.875022.22
57/640.89062522.62
29/320.9062523.02
59/640.92187523.42
15/160.937523.81
61/640.95312524.21
31/320.9687524.61
63/640.98437525.00
11.000025.40

Sheet metal gauges

Thickness of the common sheet gauges. Steel and aluminum gauges are different systems: the same number is not the same thickness.

Show the chart
GaugeSteel sheet, inAluminum sheet, in
100.13450.1019
110.11960.0907
120.10460.0808
140.07470.0641
160.05980.0508
180.04780.0403
200.03590.0320
220.02990.0253
240.02390.0201
260.01790.0159

Square key sizes for shafts

The standard square key for a shaft diameter. The keyseat in the shaft and in the hub are each half the key's height deep.

Show the chart
Shaft diameter, overUp to and includingKey width and height
7/169/161/8
9/167/83/16
7/81-1/41/4
1-1/41-3/85/16
1-3/81-3/43/8
1-3/42-1/41/2
2-1/42-3/45/8
2-3/43-1/43/4

G-code list for milling (FANUC)

Every common G-code on a machining center control, and whether it stays on until changed. Standard meanings. A machine builder can add codes and change some of these, so the machine's own manual has the last word.

Show the chart
CodeWhat it doesHow long
G00Rapid positioningStays on
G01Straight cut at the feed rateStays on
G02Arc or helix, clockwiseStays on
G03Arc or helix, counterclockwiseStays on
G04Dwell: X or P gives the timeOne block
G09Exact stop at the end of this blockOne block
G10Programmable data input: offsets and work coordinatesOne block
G11Programmable data input, cancelOne block
G15Polar coordinates, cancelStays on
G16Polar coordinates: radius and angleStays on
G17XY planeStays on
G18ZX planeStays on
G19YZ planeStays on
G20Inch inputStays on
G21Metric inputStays on
G22Stored stroke check, onStays on
G23Stored stroke check, offStays on
G27Reference position return checkOne block
G28Return to the reference position, through a pointOne block
G29Return from the reference positionOne block
G30Return to the second, third or fourth reference positionOne block
G31Skip function: move until the probe signalOne block
G33Thread cuttingStays on
G40Cutter radius compensation, cancelStays on
G41Cutter radius compensation, left of the pathStays on
G42Cutter radius compensation, right of the pathStays on
G43Tool length compensation, plus: H names the offsetStays on
G44Tool length compensation, minusStays on
G49Tool length compensation, cancelStays on
G50Scaling, cancelStays on
G51ScalingStays on
G50.1Programmable mirror image, cancelStays on
G51.1Programmable mirror imageStays on
G52Local coordinate system: a shift inside the work offsetOne block
G53Move in machine coordinatesOne block
G54Work coordinate system 1Stays on
G55Work coordinate system 2Stays on
G56Work coordinate system 3Stays on
G57Work coordinate system 4Stays on
G58Work coordinate system 5Stays on
G59Work coordinate system 6Stays on
G54.1Additional work coordinate systems: P1 to P48Stays on
G60Single direction positioningOne block
G61Exact stop modeStays on
G62Automatic corner overrideStays on
G63Tapping modeStays on
G64Cutting modeStays on
G65Macro call: P names the program, letters pass valuesOne block
G66Macro modal callStays on
G67Macro modal call, cancelStays on
G68Coordinate rotation: R gives the angleStays on
G69Coordinate rotation, cancelStays on
G73High speed peck drilling cycleStays on
G74Left-hand tapping cycleStays on
G76Fine boring cycle: orient and shift before pulling outStays on
G80Canned cycle, cancelStays on
G81Drilling cycleStays on
G82Drilling cycle with a dwell: spot face, counterboreStays on
G83Peck drilling cycle: Q is the peckStays on
G84Tapping cycleStays on
G85Boring cycle: feed in, feed outStays on
G86Boring cycle: feed in, spindle stop, rapid outStays on
G87Back boring cycleStays on
G88Boring cycle: feed in, dwell, manual outStays on
G89Boring cycle: feed in, dwell, feed outStays on
G90Absolute programmingStays on
G91Incremental programmingStays on
G92Set the work coordinate system, or clamp the spindle speedOne block
G94Feed per minuteStays on
G95Feed per revolutionStays on
G96Constant surface speedStays on
G97Constant surface speed, cancel: S is rpmStays on
G98Canned cycle: return to the initial levelStays on
G99Canned cycle: return to the R levelStays on

G-code list for turning (FANUC)

The G-codes on a lathe control, in the usual code system (system A). Standard meanings. A machine builder can add codes and change some of these, so the machine's own manual has the last word.

Show the chart
CodeWhat it doesHow long
G00Rapid positioningStays on
G01Straight cut at the feed rateStays on
G02Arc, clockwiseStays on
G03Arc, counterclockwiseStays on
G04DwellOne block
G10Programmable data inputOne block
G20Inch inputStays on
G21Metric inputStays on
G27Reference position return checkOne block
G28Return to the reference positionOne block
G30Return to the second reference positionOne block
G32Thread cutting, one passStays on
G34Variable lead thread cuttingStays on
G40Tool nose radius compensation, cancelStays on
G41Tool nose radius compensation, leftStays on
G42Tool nose radius compensation, rightStays on
G50Set the coordinate system, or clamp the top spindle speedOne block
G52Local coordinate systemOne block
G53Move in machine coordinatesOne block
G54 to G59Work coordinate systems 1 to 6Stays on
G65Macro callOne block
G66Macro modal callStays on
G67Macro modal call, cancelStays on
G70Finishing cycle: follows the profile roughed by G71, G72 or G73One block
G71Stock removal in turning: roughs along ZOne block
G72Stock removal in facing: roughs along XOne block
G73Pattern repeating: roughs parallel to the profileOne block
G74End face peck drilling, or face groovingOne block
G75Outside or inside diameter grooving, with pecksOne block
G76Multiple pass threading cycleOne block
G80Drilling canned cycle, cancelStays on
G83Face drilling cycleStays on
G84Face tapping cycleStays on
G85Face boring cycleStays on
G87Side drilling cycleStays on
G88Side tapping cycleStays on
G89Side boring cycleStays on
G90Outside or inside diameter cutting cycle, one passStays on
G92Threading cycle, one pass each blockStays on
G94End face turning cycle, one passStays on
G96Constant surface speed: S is surface speedStays on
G97Constant surface speed, cancel: S is rpmStays on
G98Feed per minuteStays on
G99Feed per revolutionStays on

M-code list

The M-codes that mean the same thing on nearly every machine. The rest are set by the machine builder: pallet changers, chip conveyors, air blast, probes and clamps all differ.

Show the chart
CodeWhat it does
M00Program stop: the cycle waits for cycle start
M01Optional stop: stops only when the optional stop switch is on
M02End of program
M30End of program and rewind to the top
M03Spindle on, clockwise
M04Spindle on, counterclockwise
M05Spindle stop
M19Spindle orientation
M06Tool change
M08Coolant on
M09Coolant off
M29Rigid tapping mode
M98Call a subprogram: P names it, L or the leading digits of P give the repeats
M99End of a subprogram: return to the calling program. In a main program, loop back to the top

Program words: what each letter means

The letters in a line of G-code and what the number after each one stands for.

Show the chart
LetterWhat it means
OProgram number
NSequence (line) number
GPreparatory function: the kind of motion or mode
MMiscellaneous function: spindle, coolant, tool change, program flow
X, Y, ZThe three straight directions of travel
A, B, CRotation about X, Y and Z
U, V, WIncremental X, Y and Z on a lathe, or extra straight directions of travel
I, J, KArc center, measured from the start point, along X, Y and Z. Also shifts in some cycles
RArc radius. In a canned cycle, the R level the tool rapids to
FFeed rate
SSpindle speed, or surface speed under G96
TTool number
HTool length offset number
DCutter radius offset number
PDwell time, program number, or work offset number, by the code it follows
QPeck depth in a drilling cycle, or a shift in a boring cycle
LNumber of repeats
/Block skip: the line is passed over when the block skip switch is on
( )A comment: the control passes over it
%Start and end of the tape or file

Custom macro: variables and commands

The variables, math, comparisons and flow commands of custom macro programming, and which letter fills which variable in a G65 call. Standard meanings. A machine builder can add codes and change some of these, so the machine's own manual has the last word.

Show the chart
ItemKindWhat it does
#0VariableAlways empty (null). Reading it gives no value
#1 to #33VariablesLocal: passed in by a macro call, cleared when the macro ends
#100 to #199VariablesCommon: shared by every program, cleared at power off
#500 to #999VariablesCommon: shared by every program, kept at power off
#1000 and upVariablesSystem: offsets, positions, alarms, clock, modal codes
+ - * /Arithmetic#101 = #102 + #103 * 2
SIN COS TAN ATANFunctionsAngles in degrees: #1 = SIN[30]
SQRT ABSFunctionsSquare root and absolute value: #1 = SQRT[#2]
ROUND FIX FUPFunctionsRound off, round toward zero, round away from zero
AND OR XORLogicBit by bit, or between conditions
EQ NECompareEqual, not equal
GT GECompareGreater than, greater than or equal
LT LECompareLess than, less than or equal
GOTO nFlowJump to sequence number n
IF [ ] GOTO nFlowJump when the condition is true: IF [#1 GT 10] GOTO 99
IF [ ] THENFlowDo one statement when true: IF [#1 EQ 0] THEN #2 = 5
WHILE [ ] DO m ... END mFlowRepeat while true; m is 1, 2 or 3
G65 P_ A_ B_ ...CallRun program P as a macro. A is #1, B is #2, C is #3
I J KCall#4, #5, #6
D E F HCall#7, #8, #9, #11
M Q R S TCall#13, #17, #18, #19, #20
U V W X Y ZCall#21, #22, #23, #24, #25, #26
#3000 = n (TEXT)AlarmStop with a macro alarm and a message
#3006 = n (TEXT)MessageStop with a message; cycle start carries on

Python keywords

The reserved words of the language: each one, what it is for, and a short example.

Show the chart
KeywordWhat it doesExample
if elif elseChoose between branchesif x > 0: ... elif x == 0: ... else: ...
for inLoop over each itemfor part in parts: ...
whileLoop while a condition holdswhile n > 0: n -= 1
break continueLeave a loop, or skip to its next turnif done: break
def returnDefine a function, and hand back its answerdef area(r): return 3.14159 * r * r
lambdaA small function with no namekey=lambda p: p.qty
classDefine a kind of objectclass Part: ...
passDo nothing; a placeholderdef later(): pass
import from asBring in a module, or names from itfrom math import sqrt as root
try except finallyCatch an error, and clean up either waytry: f() except ValueError: ... finally: ...
raiseSignal an errorraise ValueError("too long")
assertStop if a condition is falseassert qty > 0
with asOpen something and close it for youwith open("a.txt") as f: ...
and or notCombine or flip conditionsif a and not b: ...
in not inTest membershipif "x" in name: ...
is is notTest for the same objectif x is None: ...
True False NoneThe two truth values, and no valuefound = None
global nonlocalUse a name from an outer scopeglobal count
delRemove a name or an itemdel items[0]
yieldHand back one value from a generatoryield line
async awaitDefine and wait on a coroutineawait fetch(url)

Python built-in functions

The functions that are always there with nothing to import.

Show the chart
FunctionWhat it doesExample
print()Write to the screenprint("Dia:", d)
input()Read a line typed by the username = input("Name? ")
len()How many itemslen(parts)
range()A run of whole numbersrange(0, 10, 2)
int() float() str() bool()Convert to a whole number, decimal, text or truth valuefloat("0.250")
list() tuple() dict() set()Make a list, tuple, dictionary or setlist(range(3))
type() isinstance()What kind of thing it isisinstance(x, float)
abs() round()Absolute value, and roundinground(1.23456, 3)
min() max() sum()Smallest, largest and totalmax(depths)
pow() divmod()Power, and quotient with remainderdivmod(17, 5)
sorted() reversed()A sorted copy, and a backward passsorted(tools, key=len)
enumerate()Items with their countfor i, t in enumerate(tools): ...
zip()Pair up items from several listsfor x, y in zip(xs, ys): ...
map() filter()Apply a function to each item, or keep those that passlist(map(float, words))
any() all()True if any, or every, item is trueall(d > 0 for d in dims)
open()Open a fileopen("part.nc", "w")
format()Format a value as textformat(0.5, ".4f")
chr() ord()A character from its number, and backord("A")
hex() bin()Text in base 16 or base 2hex(255)
id() hash() dir() help()Look inside an objecthelp(str.split)
getattr() setattr() hasattr()Read, set or test an attribute by namegetattr(part, "qty", 1)

Python text (string) commands

What you can do with a piece of text. Here s is any text.

Show the chart
CommandWhat it doesExample
s.upper() s.lower() s.title()Change the case"g01".upper()
s.strip() s.lstrip() s.rstrip()Trim spaces from the endsline.strip()
s.split() s.splitlines()Break into a list"X1 Y2".split()
sep.join()Glue a list into one text" ".join(words)
s.replace()Swap one piece of text for anothers.replace("G0 ", "G00 ")
s.find() s.index() s.count()Where a piece is, and how oftens.find("Z")
s.startswith() s.endswith()Test the endsname.endswith(".nc")
s.isdigit() s.isalpha() s.isspace()Test what it is made of"42".isdigit()
s.zfill() s.ljust() s.rjust() s.center()Pad to a width"7".zfill(4)
s.format()Fill in the blanks"X{:.4f}".format(x)
f"..."Text with values written in placef"X{x:.4f} Y{y:.4f}"
s[a:b]A slice of the textline[1:5]
s.encode()Text to bytess.encode("utf-8")

Python list, dictionary and set commands

The commands for the three everyday containers. Here a is a list, d a dictionary and s a set.

Show the chart
CommandWhat it doesExample
a.append(x) a.extend(b) a.insert(i, x)Add to a listholes.append((x, y))
a.pop() a.remove(x) a.clear()Take out of a listlast = holes.pop()
a.sort() a.reverse()Order a list in placedepths.sort(reverse=True)
a.index(x) a.count(x) a.copy()Find, count and copytools.index("T5")
a[i] a[-1] a[a:b] a[::2]One item, the last item, a slice, every other itemfirst, last = a[0], a[-1]
[f(x) for x in a if test]Build a list from another in one line[d / 25.4 for d in mm]
d[key] d.get(key, default)Look up a value in a dictionaryfeeds.get("aluminum", 20)
d.keys() d.values() d.items()Its keys, values, or bothfor k, v in d.items(): ...
d.update(e) d.pop(key) d.setdefault(key, v)Change a dictionaryd.update(extra)
{k: v for k, v in pairs}Build a dictionary in one line{t: len(t) for t in tools}
s.add(x) s.discard(x)Change a setseen.add(name)
s | t s & t s - tUnion, overlap and difference of setsnew = now - before
a, b = b, aSwap, or unpack several values at oncex, y = point

Python operators and everyday modules

The symbols, and the standard modules most scripts reach for first.

Show the chart
ItemWhat it doesExample
+ - * /Add, subtract, multiply, divide7 / 2 is 3.5
// %Whole-number division, and the remainder7 // 2 is 3; 7 % 2 is 1
**Power2 ** 10 is 1024
== !=Equal, not equalif a == b: ...
< <= > >=Compare0 < x <= 10
= += -= *= /=Assign, or change in placetotal += 1
:=Assign inside an expressionif (n := len(a)) > 5: ...
& | ^ ~ << >>Work on the bitsflags & 0x04
x if test else yOne value or the others = "in" if inch else "mm"
#A comment to the end of the line# rough pass
"""..."""Text over several lines; a docstring"""Return the tap drill."""
mathModule: sqrt, sin, cos, tan, atan2, pi, radians, degrees, floor, ceilimport math; math.atan2(y, x)
pathlib os sysModules: files, folders and the command linePath("out").mkdir(exist_ok=True)
json csv reModules: read and write JSON and CSV, and match patternsjson.load(f)
datetime time randomModules: dates, clocks and random numbersdatetime.date.today()

C++ keywords and statements

The words of the language you meet first, with a short example of each.

Show the chart
ItemWhat it doesExample
int long short char boolWhole number, character and truth typesint count = 0;
float doubleDecimal number typesdouble dia = 0.250;
autoLet the compiler work out the typeauto it = parts.begin();
const constexprA value that cannot change; one fixed at compile timeconstexpr double PI = 3.14159265;
unsigned size_tTypes that are never negativestd::size_t n = v.size();
if else switch case defaultChoose between branchesif (x > 0) { ... } else { ... }
for while doLoopsfor (int i = 0; i < n; ++i) { ... }
for ( : )Loop over every item in a containerfor (const auto& p : parts) { ... }
break continue returnLeave a loop, skip a turn, hand back a valuereturn total;
class structDefine a type with data and functionsstruct Hole { double x, y, dia; };
public private protectedWho may reach a memberprivate: int qty_;
virtual overrideA function a derived class may replacevoid cut() override;
namespace usingGroup names, and bring them into reachusing std::string;
template typenameWrite code once for many typestemplate <typename T> T half(T x) { return x / 2; }
new deleteMake and free memory by hand; smart pointers are saferauto p = std::make_unique<Part>();
try catch throwRaise and handle errorstry { run(); } catch (const std::exception& e) { ... }
enum classA named set of choicesenum class Unit { Inch, Metric };
static inline externStorage and linkage of a namestatic int made = 0;
nullptrA pointer to nothingif (p == nullptr) return;
#include #define #ifndef #pragma onceBring in a header, define a macro, guard a header#include <vector>
// /* */Comments// rough pass
int main()Where the program startsint main() { return 0; }

C++ operators

The symbols and what each one does.

Show the chart
ItemWhat it doesExample
+ - * / %Arithmetic and remainder7 / 2 is 3; 7 % 2 is 1; 7 / 2.0 is 3.5
++ --Add or take away one++i;
= += -= *= /=Assign, or change in placetotal += qty;
== != < <= > >=Compareif (a != b) ...
&& || !And, or, notif (on && !done) ...
& | ^ ~ << >>Work on the bitsflags |= 0x04;
? :One value or the otherauto u = inch ? "in" : "mm";
* & ->Follow a pointer, take an address, reach a member through a pointerp->qty
::A name inside a namespace or classstd::cout
.A member of an objecthole.dia
[]An item of an array or containerv[0]
static_cast<T>()Convert between types on purposestatic_cast<double>(n)
sizeof()The size of a type or object in bytessizeof(int)
<< >> with streamsWrite to, or read from, a streamstd::cout << x << "\n";
[ ]( ){ }A lambda: a small function written in place[&](int x) { return x * k; }

C++ standard library

The containers, streams and functions most programs reach for.

Show the chart
ItemWhat it doesExample
std::stringTextstd::string name = "plate";
std::vector<T>A list that growsstd::vector<double> d{0.25, 0.5};
std::array<T, N>A list of fixed lengthstd::array<int, 3> xyz{};
std::map std::unordered_mapLook up a value by a keyfeeds["aluminum"] = 20;
std::setUnique items, kept in orderseen.insert(id);
std::pair std::tupleTwo or more values togetherauto [x, y] = point;
std::optional<T>A value that may be missingif (auto d = find(id)) use(*d);
push_back emplace_back pop_backAdd to, or take from, the end of a vectorv.push_back(0.375);
size empty clear begin endWhat every container offersif (!v.empty()) ...
std::cout std::cin std::cerrScreen out, keyboard in, error outstd::cout << "Dia: " << d << "\n";
std::ifstream std::ofstreamRead and write filesstd::ofstream out("part.nc");
std::getlineRead one line of textwhile (std::getline(in, line)) ...
std::sort std::find std::countOrder and search a rangestd::sort(v.begin(), v.end());
std::min std::max std::accumulateSmallest, largest and totalstd::accumulate(v.begin(), v.end(), 0.0)
std::sqrt std::sin std::cos std::atan2 std::absMath, from <cmath>std::atan2(y, x)
std::to_string std::stod std::stoiNumber to text and backstd::stod("0.250")
std::unique_ptr std::shared_ptrPointers that free themselvesauto p = std::make_shared<Tool>();
std::thread std::mutexRun work side by side, and guard shared datastd::thread t(run); t.join();
std::chronoClocks and time spansauto t0 = std::chrono::steady_clock::now();

C: printf formats and library functions

The print formats and the everyday functions of the C standard library.

Show the chart
ItemWhat it doesExample
printf()Print with a formatprintf("X%.4f Y%.4f\n", x, y);
%d %ld %uFormat: whole numbersprintf("%d", qty);
%f %.3f %e %gFormat: decimals, with places, or powers of tenprintf("%.3f", dia);
%s %c %x %p %%Format: text, one character, base 16, a pointer, a percent signprintf("%s", name);
scanf() fgets()Read typed input, or one linefgets(line, sizeof line, stdin);
fopen() fclose() fprintf() fscanf()Open, close, write and read a fileFILE *f = fopen("a.txt", "w");
malloc() calloc() realloc() free()Get and give back memorydouble *d = malloc(n * sizeof *d);
strlen() strcpy() strcat() strcmp()Length, copy, join and compare textif (strcmp(a, b) == 0) ...
strtol() strtod() atoi() atof()Text to a numberdouble v = strtod(s, NULL);
sqrt() pow() sin() cos() atan2() fabs()Math, from math.hdouble h = sqrt(a * a + b * b);
struct typedef enum unionBuild your own typestypedef struct { double x, y; } Point;
* & -> []Pointers, addresses and arraysint *p = &count;
#include #define #ifdefHeaders, macros and conditional code#define MAX 64
stdio.h stdlib.h string.h math.hThe headers used most#include <stdio.h>
int main(int argc, char *argv[])Where the program starts, with its command linereturn 0;
sizeofThe size of a type or object in bytessizeof(double)

JavaScript language

The statements and operators of the language of web pages.

Show the chart
ItemWhat it doesExample
let const varDeclare a name; const cannot be reassignedconst dia = 0.25;
function =>Define a functionconst half = (x) => x / 2;
if else switchChoose between branchesif (x > 0) { ... } else { ... }
for for...of for...in whileLoops: counted, over items, over keys, while truefor (const p of parts) { ... }
return break continueHand back a value, leave a loop, skip a turnreturn total;
=== !==Equal and not equal, with no type conversionif (a === b) ...
&& || ! ??And, or, not, and "use this if the left is missing"const n = qty ?? 1;
?.Reach a member only if the object is therepart?.name
...Spread a list or object out, or gather the restconst all = [...a, ...b];
`text ${x}`Text with values written in place`X${x.toFixed(4)}`
{ a, b } = obj [x, y] = listUnpack values by name or by placeconst [x, y] = point;
class extends new thisDefine and make objectsclass Hole extends Feature { ... }
try catch finally throwRaise and handle errorstry { run(); } catch (e) { ... }
async await PromiseWait on work that finishes laterconst r = await fetch(url);
import exportShare code between filesimport { area } from "./math.js";
typeof instanceofWhat kind of thing it istypeof x === "number"
null undefined NaNNo value, not yet set, and not a numberNumber.isNaN(x)

JavaScript arrays, text and built-ins

The commands for lists, text, numbers and the page. Here a is an array, s is text and n a number.

Show the chart
ItemWhat it doesExample
a.push() a.pop() a.shift() a.unshift()Add or take from the ends of an arrayholes.push([x, y]);
a.map() a.filter() a.reduce()Change each item, keep some, or fold to one valuemm.map((d) => d / 25.4)
a.find() a.includes() a.indexOf() a.some() a.every()Search an arraytools.includes("T5")
a.sort() a.reverse() a.slice() a.splice() a.join()Order, cut and glue an arraya.sort((x, y) => x - y)
s.split() s.trim() s.replace() s.slice()Break, trim, swap and cut textline.trim().split(" ")
s.includes() s.startsWith() s.endsWith()Test textname.endsWith(".nc")
s.toUpperCase() s.toLowerCase() s.padStart()Change case, and pad to a width"7".padStart(4, "0")
Number() parseFloat() parseInt() n.toFixed()Text to a number, and a number to fixed places(0.5).toFixed(4)
Math.sqrt Math.abs Math.round Math.floor Math.ceilEveryday mathMath.round(x * 1000) / 1000
Math.sin Math.cos Math.atan2 Math.PITrig, in radiansMath.atan2(y, x)
Math.min Math.max Math.randomSmallest, largest, a random numberMath.max(...depths)
Object.keys() Object.values() Object.entries()The names, values or both of an objectfor (const [k, v] of Object.entries(o)) ...
JSON.parse() JSON.stringify()Text to data and backJSON.stringify(part, null, 2)
Map SetLook up by key; a set of unique itemsconst seen = new Set();
DateDates and timesnew Date().toISOString()
console.log()Print for the programmerconsole.log("dia", d);
document.querySelector() addEventListener()In a web page: find an element and listen to itbtn.addEventListener("click", run);
setTimeout() setInterval()Run later, or again and againsetTimeout(done, 500);
fetch()Ask a server for somethingconst r = await fetch("/api/jobs");

Java quick reference

The everyday statements, types and collections.

Show the chart
ItemWhat it doesExample
int long double boolean char StringThe everyday typesdouble dia = 0.250;
finalA value that cannot changefinal int MAX = 64;
if else switchChoose between branchesif (x > 0) { ... }
for while doLoopsfor (int i = 0; i < n; i++) { ... }
for ( : )Loop over every itemfor (Hole h : holes) { ... }
class interface extends implementsDefine types and how they relateclass Mill extends Machine { ... }
public private protected staticWho may reach a member, and whether it belongs to the classprivate int qty;
new this superMake an object, and name itself or its parentPart p = new Part("plate");
try catch finally throw throwsRaise and handle errorstry { run(); } catch (IOException e) { ... }
public static void main(String[] args)Where the program startsSystem.out.println("Ready");
System.out.println() String.format()Print, and format textString.format("X%.4f", x)
ArrayList<T> HashMap<K, V> HashSet<T>A growing list, a lookup table, a set of unique itemsList<Double> d = new ArrayList<>();
add get set remove size containsWhat the collections offerd.add(0.375);
Math.sqrt Math.abs Math.round Math.atan2 Math.PIEveryday mathMath.sqrt(a * a + b * b)
equals() length() substring() split() trim()Working with textif (a.equals(b)) ...
Integer.parseInt() Double.parseDouble()Text to a numberDouble.parseDouble("0.250")
import packageBring in, and name, a group of classesimport java.util.List;
varLet the compiler work out the typevar holes = new ArrayList<Hole>();

C# quick reference

The everyday statements, types and collections.

Show the chart
ItemWhat it doesExample
int long double decimal bool char stringThe everyday typesdouble dia = 0.250;
varLet the compiler work out the typevar holes = new List<Hole>();
const readonlyValues that cannot changeconst int Max = 64;
if else switchChoose between branchesif (x > 0) { ... }
for foreach while doLoopsforeach (var h in holes) { ... }
class struct record interface enumDefine your own typesrecord Hole(double X, double Y, double Dia);
public private protected internal staticWho may reach a memberprivate int qty;
get setA property: a value with code behind itpublic int Qty { get; set; }
new this baseMake an object, and name itself or its parentvar p = new Part("plate");
try catch finally throwRaise and handle errorstry { Run(); } catch (IOException e) { ... }
usingBring in a namespace, or close something for youusing var f = File.OpenText(path);
async await TaskWait on work that finishes latervar s = await client.GetStringAsync(url);
$"text {x}"Text with values written in place$"X{x:F4} Y{y:F4}"
List<T> Dictionary<K, V> HashSet<T>A growing list, a lookup table, a set of unique itemsvar d = new List<double>();
Where Select OrderBy First Any SumLINQ: filter, change, order and total a listholes.Where(h => h.Dia > 0.25).Count()
Console.WriteLine() Console.ReadLine()Print and read a lineConsole.WriteLine("Ready");
Math.Sqrt Math.Abs Math.Round Math.Atan2 Math.PIEveryday mathMath.Round(x, 3)
int.Parse() double.TryParse()Text to a numberdouble.TryParse(s, out var v)
?. ??Reach a member only if it is there; a fallback valuename ?? "none"

SQL commands

The commands for reading and changing tables. Take care with UPDATE and DELETE: with no WHERE they touch every row.

Show the chart
ItemWhat it doesExample
SELECT ... FROMRead columns from a tableSELECT po, part, due FROM jobs;
WHEREKeep only the rows that matchWHERE status = 'In progress'
AND OR NOT IN BETWEEN LIKEBuild a conditionWHERE due BETWEEN '2026-12-01' AND '2026-12-31'
IS NULL IS NOT NULLTest for a missing valueWHERE delivered IS NULL
ORDER BY ASC DESCSort the resultORDER BY due ASC
LIMIT OFFSETTake only some rowsLIMIT 10
DISTINCTEach different value onceSELECT DISTINCT customer FROM jobs;
COUNT SUM AVG MIN MAXAdd up or summarize rowsSELECT COUNT(*) FROM jobs;
GROUP BY HAVINGSummarize by group, and filter the groupsGROUP BY customer HAVING COUNT(*) > 3
JOIN ... ONMatch rows from two tablesFROM jobs j JOIN customers c ON c.name = j.customer
LEFT JOINKeep every row on the left, matched or notLEFT JOIN files f ON f.job_id = j.id
ASGive a column or table another nameSELECT amount * qty AS total
INSERT INTO ... VALUESAdd a rowINSERT INTO jobs (po, part) VALUES ('1001', 'Plate');
UPDATE ... SET ... WHEREChange rows. Without WHERE it changes them allUPDATE jobs SET status = 'Complete' WHERE id = 7;
DELETE FROM ... WHERERemove rows. Without WHERE it removes them allDELETE FROM jobs WHERE id = 7;
CREATE TABLEMake a tableCREATE TABLE tools (id INTEGER PRIMARY KEY, name TEXT);
ALTER TABLE DROP TABLEChange or remove a tableALTER TABLE jobs ADD COLUMN machine TEXT;
PRIMARY KEY NOT NULL UNIQUE DEFAULTRules on a columnqty INTEGER NOT NULL DEFAULT 1
CREATE INDEXSpeed up lookups on a columnCREATE INDEX jobs_due ON jobs (due);
BEGIN COMMIT ROLLBACKGroup changes so all happen or none doBEGIN; ... COMMIT;
CASE WHEN ... THEN ... ENDA value that depends on a conditionCASE WHEN due < date('now') THEN 'late' ELSE 'ok' END
--A comment to the end of the line-- open jobs only

Bash and Linux shell commands

The commands of the Linux and macOS command line.

Show the chart
ItemWhat it doesExample
pwd ls cdWhere am I, what is here, go therels -la
mkdir rmdir touchMake and remove folders, make an empty filemkdir -p out/parts
cp mv rmCopy, move or rename, remove. There is no undo for rmcp part.nc backup/
cat less head tailShow a file: all, a page at a time, the top, the endtail -n 20 run.log
grepFind lines that matchgrep -n "G84" *.nc
findFind files by name, age or sizefind . -name "*.nc" -mtime -7
sort uniq wc cutOrder lines, drop repeats, count, pick columnssort tools.txt | uniq -c
sed awkChange text, and work on columnssed 's/G0 /G00 /g' in.nc > out.nc
| > >> <Pipe into the next command; write, add to, or read from a filels | wc -l
&& || ;Run the next only if this worked, only if it failed, or either waymake && ./run
$VAR ${VAR} $(command)The value of a variable, or the output of a commandecho "$HOME"
chmod chownChange who may read, write and run a filechmod +x run.sh
ps top killSee what is running, and stop itps aux | grep node
df duDisk space free, and space a folder usesdu -sh *
tar zip unzipPack and unpack filestar -czf parts.tgz parts/
ssh scp rsyncRun on another machine, and copy files to itscp part.nc user@host:/nc/
curl wgetFetch from a web addresscurl -s https://example.com/api
if [ ... ]; then ... fiA branch in a scriptif [ -f part.nc ]; then echo ok; fi
for x in ...; do ... doneA loop in a scriptfor f in *.nc; do wc -l "$f"; done
man --helpRead the manual for a commandman grep

PowerShell commands

The commands of the Windows command line, with their short names where they have one.

Show the chart
ItemWhat it doesExample
Get-ChildItem (ls, dir)List files and foldersGet-ChildItem -Recurse -Filter *.nc
Set-Location (cd)Go to a folderSet-Location D:\Jobs
Get-Content (cat)Read a fileGet-Content run.log -Tail 20
Set-Content Add-Content Out-FileWrite, or add to, a file"done" | Add-Content run.log
Copy-Item Move-Item Remove-Item New-ItemCopy, move, remove and make files or foldersNew-Item -ItemType Directory out
Select-StringFind lines that matchSelect-String -Path *.nc -Pattern "G84"
Where-Object (?)Keep the items that matchGet-Process | Where-Object CPU -gt 100
ForEach-Object (%)Do something to each item1..5 | ForEach-Object { $_ * 2 }
Select-Object Sort-Object Measure-ObjectPick columns, order, and count or totalGet-ChildItem | Sort-Object Length -Descending
|Pass objects, not text, to the next commandGet-Service | Where-Object Status -eq Running
$name = valueA variable$dia = 0.250
"text $name" 'text'Text with values filled in; text taken as written"Dia: $dia"
-eq -ne -gt -ge -lt -le -like -matchCompareif ($n -gt 10) { ... }
if elseif else foreach while switchFlowforeach ($f in $files) { ... }
functionDefine a command of your ownfunction Get-Area($r) { [math]::PI * $r * $r }
Get-Process Stop-Process Get-ServiceSee and stop what is runningStop-Process -Name notepad
Test-Path Join-Path Split-PathDoes it exist; build and take apart a pathif (Test-Path part.nc) { ... }
ConvertTo-Json ConvertFrom-Json Import-Csv Export-CsvRead and write JSON and CSVImport-Csv tools.csv
Get-Help Get-Command Get-MemberFind out what a command does and what an object holdsGet-Help Copy-Item -Examples

Git commands

The commands for keeping the history of a project.

Show the chart
ItemWhat it doesExample
git init git cloneStart a repository, or copy onegit clone https://example.com/shop.git
git statusWhat has changedgit status --short
git addStage changes for the next commitgit add src/part.js
git commitRecord the staged changesgit commit -m "Add tap drill chart"
git logThe historygit log --oneline -10
git diffWhat changed, line by linegit diff --stat
git branch git switchList, make and move between branchesgit switch -c fix-chart
git merge git rebaseBring another branch's work into this onegit merge fix-chart
git pull git fetchGet the latest from the server, with or without merginggit pull
git pushSend your commits to the servergit push origin main
git restoreThrow away changes in a file. There is no undogit restore src/part.js
git stashSet changes aside for latergit stash; git stash pop
git revertUndo a commit with a new commitgit revert abc1234
git tagName a point in the historygit tag v1.2
git remoteThe servers this repository knowsgit remote -v
git blame git showWho last changed each line; one commit in fullgit show abc1234
.gitignoreA file listing what git should leave alonenode_modules/

HTML tags

The tags that make up a web page.

Show the chart
TagWhat it isExample
<!doctype html> <html> <head> <body>The frame of every page<html lang="en">
<title> <meta> <link>The page's name, facts about it, and linked files<meta name="viewport" content="width=device-width">
<h1> to <h6>Headings, largest to smallest<h1>Tap drill chart</h1>
<p> <br> <hr>A paragraph, a line break, a rule<p>Check the print.</p>
<a href>A link<a href="/quote">Get a quote</a>
<img src alt>A picture, with words for when it cannot be seen<img src="part.jpg" alt="Finished part">
<ul> <ol> <li>Bulleted and numbered lists<ul><li>Aluminum</li></ul>
<table> <tr> <th> <td>A table, its rows, heading cells and cells<tr><th>Thread</th><td>1/4-20</td></tr>
<div> <span>A block and an inline box with no meaning of their own<div class="card">...</div>
<header> <nav> <main> <section> <footer>The named parts of a page<main id="main">...</main>
<form> <label> <input> <button>A form and its controls<input type="number" name="qty">
<select> <option> <textarea>A pick list and a large text box<select><option>Aluminum</option></select>
id className one element, or a group of them<p class="note">
<strong> <em> <code>Strong importance, emphasis, code<code>G84</code>
<script src>Load a script file<script src="/js/app.js"></script>
<!-- -->A comment<!-- chart starts here -->

CSS selectors and properties

How a web page is styled: what to select, and the properties used most.

Show the chart
ItemWhat it doesExample
selector { property: value; }The shape of every rulep { color: #222; }
.name #name tagSelect by class, by id, by element.card { padding: 16px; }
a b a > b a, bInside, directly inside, either one.card > h3
:hover :focus :first-child :not()Select by state or positiona:hover { color: blue; }
color backgroundText color and what is behind itbackground: #f3f5f7;
font-family font-size font-weight line-heightThe typefont-size: 17px;
margin padding borderSpace outside, space inside, and the edgepadding: 12px 16px;
width height max-width min-heightSizemax-width: 62ch;
display: block | inline | none | flex | gridHow a box is laid outdisplay: grid;
flex gap justify-content align-itemsLay out along a row or columndisplay: flex; gap: 12px;
grid-template-columnsLay out in columnsgrid-template-columns: repeat(3, 1fr);
position: relative | absolute | fixed | stickyPlace a box out of the normal flowposition: sticky; top: 0;
px % em rem chUnits: pixels, share of the parent, type size, character widthwidth: 50%;
@mediaRules for some screens only@media (max-width: 600px) { ... }
--name var(--name)A value kept under a namecolor: var(--ink);
transition transformEase a change, and move or turn a boxtransition: opacity .2s;
/* */A comment/* chart table */

RPE chart: percent of max by reps

The share of a one-rep max a set is, by its reps and how hard it was. RPE 10 is nothing left, 9 is one rep in the tank, 8 is two. An average over many lifters: use it to pick a starting weight.

Show the chart
RPE1 rep2 reps3 reps4 reps5 reps6 reps7 reps8 reps9 reps10 reps
10100.0%95.5%92.2%89.2%86.3%83.7%81.1%78.6%76.2%73.9%
9.597.8%93.9%90.7%87.8%85.0%82.4%79.9%77.4%75.1%72.3%
995.5%92.2%89.2%86.3%83.7%81.1%78.6%76.2%73.9%70.7%
8.593.9%90.7%87.8%85.0%82.4%79.9%77.4%75.1%72.3%69.4%
892.2%89.2%86.3%83.7%81.1%78.6%76.2%73.9%70.7%68.0%
7.590.7%87.8%85.0%82.4%79.9%77.4%75.1%72.3%69.4%66.7%
789.2%86.3%83.7%81.1%78.6%76.2%73.9%70.7%68.0%65.3%
6.587.8%85.0%82.4%79.9%77.4%75.1%72.3%69.4%66.7%64.0%
686.3%83.7%81.1%78.6%76.2%73.9%70.7%68.0%65.3%62.6%

Common medications: kind, use and prescription status

Click a medication to see its official FDA label: what it is for, boxed warning, contraindications and adverse reactions, in the label's own words. The chart itself gives only the plain facts, by generic name: what kind of drug it is, what it is commonly used for, and whether it needs a prescription in the United States. Not medical advice.

Show the chart
MedicationKind of drugCommonly used forIn the United States
acetaminophenPain reliever and fever reducerPain, feverOver the counter
ibuprofenNSAID (anti-inflammatory)Pain, fever, inflammationOver the counter; higher strengths by prescription
naproxenNSAID (anti-inflammatory)Pain, inflammationOver the counter; higher strengths by prescription
aspirinNSAID and antiplateletPain, fever; heart and stroke protectionOver the counter
diphenhydramineAntihistamineAllergy, itching, sleep aidOver the counter
loratadineAntihistamineAllergyOver the counter
cetirizineAntihistamineAllergyOver the counter
famotidineH2 blockerHeartburn, ulcersOver the counter and prescription
omeprazoleProton pump inhibitorAcid reflux, ulcersOver the counter and prescription
pantoprazoleProton pump inhibitorAcid reflux, ulcersPrescription
guaifenesinExpectorantChest congestionOver the counter
dextromethorphanCough suppressantCoughOver the counter
loperamideAntidiarrhealDiarrheaOver the counter
docusateStool softenerConstipationOver the counter
polyethylene glycol 3350Osmotic laxativeConstipationOver the counter
lisinoprilACE inhibitorHigh blood pressure, heart failurePrescription
losartanAngiotensin receptor blockerHigh blood pressurePrescription
amlodipineCalcium channel blockerHigh blood pressure, anginaPrescription
metoprololBeta blockerHigh blood pressure, angina, heart rate controlPrescription
carvedilolBeta blockerHeart failure, high blood pressurePrescription
hydrochlorothiazideThiazide diureticHigh blood pressure, fluid retentionPrescription
furosemideLoop diureticFluid overload, swellingPrescription
spironolactonePotassium-sparing diureticHeart failure, fluid retentionPrescription
atorvastatinStatinHigh cholesterolPrescription
simvastatinStatinHigh cholesterolPrescription
rosuvastatinStatinHigh cholesterolPrescription
clopidogrelAntiplateletPreventing clots after a heart attack, stent or strokePrescription
warfarinAnticoagulantPreventing and treating blood clotsPrescription
apixabanAnticoagulantPreventing and treating blood clotsPrescription
rivaroxabanAnticoagulantPreventing and treating blood clotsPrescription
heparinAnticoagulant, by injectionPreventing and treating blood clotsPrescription
enoxaparinAnticoagulant, by injectionPreventing and treating blood clotsPrescription
nitroglycerinNitrateAngina (chest pain)Prescription
epinephrineAdrenergicSevere allergic reaction, cardiac arrestPrescription
potassium chlorideElectrolyteLow potassiumPrescription
metforminBiguanideType 2 diabetesPrescription
glipizideSulfonylureaType 2 diabetesPrescription
insulin glargineLong-acting insulinDiabetesPrescription
insulin lisproRapid-acting insulinDiabetesPrescription
levothyroxineThyroid hormoneUnderactive thyroidPrescription
prednisoneCorticosteroidInflammation, immune and allergic conditionsPrescription
methylprednisoloneCorticosteroidInflammation, immune and allergic conditionsPrescription
albuterolShort-acting bronchodilatorAsthma and COPD wheezingPrescription
fluticasoneCorticosteroid, inhaled or nasalAsthma (inhaled); nasal allergy (spray)Nasal spray over the counter; inhaler by prescription
montelukastLeukotriene blockerAsthma, allergyPrescription
amoxicillinPenicillin antibioticBacterial infectionsPrescription
amoxicillin with clavulanatePenicillin antibiotic with an enzyme blockerBacterial infectionsPrescription
azithromycinMacrolide antibioticBacterial infectionsPrescription
cephalexinCephalosporin antibioticBacterial infectionsPrescription
ceftriaxoneCephalosporin antibiotic, by injectionBacterial infectionsPrescription
ciprofloxacinFluoroquinolone antibioticBacterial infectionsPrescription
doxycyclineTetracycline antibioticBacterial infectionsPrescription
sulfamethoxazole with trimethoprimSulfa antibioticBacterial infectionsPrescription
vancomycinGlycopeptide antibioticSerious bacterial infectionsPrescription
sertralineSSRI antidepressantDepression, anxietyPrescription
fluoxetineSSRI antidepressantDepression, anxietyPrescription
escitalopramSSRI antidepressantDepression, anxietyPrescription
citalopramSSRI antidepressantDepressionPrescription
bupropionAntidepressantDepression, stopping smokingPrescription
trazodoneAntidepressantDepression, sleepPrescription
gabapentinAnticonvulsantNerve pain, seizuresPrescription
lorazepamBenzodiazepineAnxiety, seizures, sedationPrescription, controlled substance
alprazolamBenzodiazepineAnxiety, panicPrescription, controlled substance
zolpidemSleep medicineInsomniaPrescription, controlled substance
morphineOpioidSevere painPrescription, controlled substance
oxycodoneOpioidSevere painPrescription, controlled substance
hydrocodone with acetaminophenOpioid with a pain relieverModerate to severe painPrescription, controlled substance
fentanylOpioidSevere pain, anesthesiaPrescription, controlled substance
tramadolOpioidModerate painPrescription, controlled substance
naloxoneOpioid blockerOpioid overdoseNasal spray over the counter; other forms by prescription
ondansetronAntiemeticNausea and vomitingPrescription
tamsulosinAlpha blockerEnlarged prostatePrescription

Thin-wall cylinder under pressure

Hoop and lengthwise stress in a closed cylinder with internal pressure. Holds when the wall is no more than a tenth of the inside radius.

hoop = p r / t, lengthwise = p r / (2 t), r = inside radius

Thin-wall sphere under pressure

Membrane stress in a sphere, or a hemispherical head, with internal pressure.

stress = p r / (2 t), r = inside radius

Barlow's formula for pipe and tube

The internal pressure that puts a chosen stress in the wall of a pipe or tube. Put in yield for the pressure at yield, or your allowable stress for a working pressure.

P = 2 S t / OD

Thick-wall cylinder (Lame)

Stress at the bore of a thick cylinder with internal pressure only. The bore is where the stress is highest.

hoop at bore = p (ro² + ri²) / (ro² - ri²), radial at bore = -p, max shear = p ro² / (ro² - ri²)

Pin or bolt in shear

Average shear stress across a round pin or bolt. Two shear planes is a clevis, where the pin is cut in two places.

shear stress = F / (planes x π d² / 4)

Punching or blanking force

The force to shear a shape out of sheet or plate. The cut length is the distance all the way round the shape.

F = cut length x thickness x shear strength

Bolt torque and preload

The torque that gives a chosen clamp load. K is the nut factor: about 0.2 for plain dry steel, about 0.15 lubricated. It is an estimate; friction moves it a lot.

T = K d F

Tensile stress area of a Unified thread

The area a threaded fastener carries tension on, and the stress under a load.

At = 0.7854 (D - 0.9743 / n)², n = threads per inch

Tap drill for a percent of thread

The drill size that leaves a chosen percent of full thread for a 60 degree inch thread. 75 percent is the usual choice; 65 is easier on taps in tough material.

drill = D - 0.01299 x percent / n

Section properties

Area, moment of inertia and section modulus for a beam's cross section. For a rectangle, the height is the side in line with the load.

rectangle I = b h³ / 12, round I = π d⁴ / 64, tube I = π (D⁴ - d⁴) / 64, S = I / c

Beam bending and deflection

The largest bending moment, stress and deflection for six common cases. The load is the total load on the beam. Take I and the distance to the outer fiber from the section calculator above.

stress = M c / I. Cantilever, end load: M = P L, y = P L³ / 3EI. Cantilever, even load: M = W L / 2, y = W L³ / 8EI. Simple, center load: M = P L / 4, y = P L³ / 48EI. Simple, even load: M = W L / 8, y = 5 W L³ / 384EI. Fixed ends, center load: M = P L / 8, y = P L³ / 192EI. Fixed ends, even load: M = W L / 12, y = W L³ / 384EI.

Shaft in torsion

Shear stress at the surface and the angle of twist for a round shaft. Put 0 for the inside diameter of a solid shaft.

J = π (D⁴ - d⁴) / 32, shear stress = T D / (2 J), twist = T L / (G J)

Column buckling (Euler)

The load at which a long, slender column buckles. K is the end factor: 1 pinned at both ends, 0.5 fixed at both, 0.7 fixed and pinned, 2 fixed and free. It does not apply to short, stocky columns, which crush first.

Pcr = π² E I / (K L)²

Power, torque and speed

The torque a shaft carries for a power and a speed.

T = 63025 x hp / rpm (in·lbf)

Axial stress and stretch

Stress in a bar pulled or pushed along its length, and how much it changes length.

stress = F / A, change in length = F L / (A E)

Principal and von Mises stress (plane stress)

Combines two normal stresses and a shear stress at a point into the principal stresses, the largest in-plane shear and the von Mises stress, and compares that with yield.

principal = (sx + sy) / 2 ± √(((sx - sy) / 2)² + txy²), von Mises = √(sx² - sx sy + sy² + 3 txy²)

Thermal growth

How much a length changes with temperature. Typical expansion, in millionths per degree F: carbon steel about 6.5, stainless about 9.6, aluminum about 13, brass about 10.4, titanium about 4.8.

change = expansion x length x temperature change

Press fit pressure and holding force

Contact pressure for a solid shaft pressed into a hub of the same material, and the push it takes to slide it. The interference is on the diameter.

p = (E x interference / (2 d)) x (1 - (d / D)²), holding force = friction x p x π d L

Spindle speed and feed

Spindle speed from surface speed and cutter diameter, and table feed from the chip load per tooth.

rpm = 3.82 x SFM / diameter, feed = rpm x teeth x chip load

Metal removal rate and spindle power

Volume cut per minute in milling, and the power it takes. Unit power, in hp per cubic inch a minute: aluminum about 0.3, carbon steel about 1, stainless about 1.3, titanium about 1.2.

removal rate = width x depth x feed, power = removal rate x unit power

Bolt circle coordinates

X and Y for each hole on a bolt circle, from the center of the circle. The first hole sits at the start angle, measured from the X direction, and the rest go counterclockwise.

x = (D / 2) cos(angle), y = (D / 2) sin(angle)

Weight of stock

Weight of a plate, a round bar or a round tube. Typical density, in pounds per cubic inch: carbon steel 0.284, stainless 0.29, aluminum 0.098, brass 0.307, copper 0.323, titanium 0.163, acetal 0.051.

weight = volume x density

Sine bar stack

The gauge block stack that sets a sine bar or sine plate to an angle.

stack = bar length x sin(angle)

Taper

Taper per foot, taper per inch and the angles for a round taper from its two diameters and length.

taper per inch = (D - d) / L, half angle = atan((D - d) / (2 L))

Drill point length

How far the point of a drill runs past the full diameter. Add it to the depth you program when the print gives full-diameter depth.

point length = (diameter / 2) / tan(point angle / 2)

Tolerance stack

Adds a chain of plus-or-minus tolerances two ways: worst case, and root sum square, which is the likely spread when the parts vary on their own. Put the tolerances in with commas between them.

worst case = sum of the tolerances, RSS = √(sum of their squares)

Three-wire thread measurement

The reading over three wires for a 60 degree inch thread at its basic pitch diameter. Leave the wire at 0 to use the best wire size.

best wire = 0.57735 / n, pitch diameter = D - 0.64952 / n, over wires = pitch diameter + 3 W - 0.86603 / n

Metric tap drill

The usual tap drill for a metric thread: the diameter less the pitch, which leaves about three quarters of full thread.

drill = D - pitch

Thread lead angle

The helix angle of a thread at its pitch diameter. The lead is the pitch times the number of starts.

angle = atan(lead / (π x pitch diameter))

Countersink depth

How deep to feed a countersink, from where its edge first touches the hole, to reach a head diameter.

depth = (head diameter - hole diameter) / 2 / tan(angle / 2)

Ball end mill: working diameter and scallop

The diameter a ball end mill really cuts on at a shallow depth, and the height of the ridge left between passes.

working diameter = 2 √(depth x (D - depth)), scallop = R - √(R² - (stepover / 2)²)

Radial chip thinning

With a light side cut the chip is thinner than the feed per tooth. This gives the feed per tooth that brings the chip back to the thickness you want. It applies when the width of cut is under half the cutter.

factor = 1 / √(1 - (1 - 2 x width / D)²), feed per tooth = chip thickness x factor

Turning finish from feed and nose radius

The finish a turning insert leaves in theory. The real finish is rougher: use it to pick a feed, not to promise a number.

peak to valley = feed² / (8 x nose radius), Ra is about a quarter of that

Cutting time

Time in the cut for a length at a feed, over a number of passes.

time = length x passes / feed

Decimal to fraction

The nearest inch fraction to a decimal, down to 64ths, and how far off it is.

nearest 64th, reduced

Compression spring rate

The rate of a round-wire coil spring, and its load at a deflection. Use the mean coil diameter (outside diameter less one wire) and the active coils.

rate = G d⁴ / (8 D³ N)

Shaft key in shear and bearing

Stress in a square or flat key carrying torque. Half the key's height bears on the shaft and half on the hub.

force = 2 T / d, shear = force / (w L), bearing = force / (h L / 2)

Fillet weld throat stress

Average stress on the throat of an equal-leg fillet weld. The throat is 0.707 of the leg. The length is the total length of weld carrying the load.

stress = F / (0.707 x leg x length)

Hydraulic or air cylinder

Push and pull force of a cylinder at a pressure, and its speed for a flow. Put 0 for the flow to skip the speed.

push = p π bore² / 4, pull = p π (bore² - rod²) / 4, speed = 231 x gpm / area

Rolling bearing life (L10)

The basic rating life nine bearings in ten reach, from the dynamic load rating in the maker's catalog and the load carried.

L10 = (C / P)^k million revolutions, k = 3 for ball, 10/3 for roller

Pulley or gear ratio

Speed of the driven shaft, the ratio, and the belt speed. For gears, put tooth counts in place of the diameters and ignore the belt speed.

driven rpm = driver rpm x driver / driven, belt speed = π x diameter x rpm / 12

Spur gear sizes

The main sizes of a standard full-depth spur gear from its tooth count and diametral pitch.

pitch diameter = N / P, outside diameter = (N + 2) / P, circular pitch = π / P, whole depth = 2.25 / P

Centrifugal force

The outward force on a weight turning about a center, such as a part held off center in a chuck or fixture.

F = W r (2 π rpm / 60)² / 386.09

Natural frequency of a weight on a spring

The frequency a weight bounces at on a spring or any support with a known stiffness.

f = (1 / 2π) √(k x 386.09 / W)

Flow velocity in a pipe or port

How fast a liquid moves through a round bore at a flow rate.

velocity = 0.4085 x gpm / d² (ft/s)

Shear modulus from E and Poisson's ratio

The shear modulus of an ordinary metal from its modulus of elasticity and Poisson's ratio. About 0.29 for steel and 0.33 for aluminum.

G = E / (2 (1 + ν))

Shrink fit heating

How much hotter the hub must be than the shaft to slip on with a chosen clearance. Typical expansion is in the thermal growth calculator.

temperature rise = (interference + clearance) / (expansion x diameter)

Hole and shaft fit

The loosest and tightest a hole and shaft can go together from their size limits. A negative clearance is interference.

loosest = largest hole - smallest shaft, tightest = smallest hole - largest shaft

Right triangle

Solves a right triangle from any two of its parts. Side a is opposite angle A, side b is beside it, and c is the long side.

c² = a² + b², sin A = a / c, cos A = b / c, tan A = a / b

Any triangle from three sides

The three angles and the area of a triangle from the lengths of its sides.

cos A = (b² + c² - a²) / (2 b c), area = √(s (s - a)(s - b)(s - c)), s = half the perimeter

Circle

Circumference and area of a circle from its diameter.

circumference = π d, area = π d² / 4

Arc, chord and segment

For a slice of a circle with a radius and an angle at the center: the arc length, the straight chord across it, the height of the arc above the chord, and the areas.

arc = r θ, chord = 2 r sin(θ / 2), height = r (1 - cos(θ / 2)), sector = r² θ / 2, segment = r² (θ - sin θ) / 2

Radius from a chord and its height

Finds a radius you cannot measure directly: lay a straight edge across the arc, and measure its length and the gap at the middle.

r = (chord² / 4 + height²) / (2 x height)

Regular polygon (hex, square, octagon)

The sizes of a shape with equal sides, from its number of sides and the distance across the flats. For a shape with an odd number of sides the flat-to-flat size is twice the distance from the center to a flat.

across corners = F / cos(180° / n), side = F tan(180° / n), area = n F² tan(180° / n) / 4

Volume and surface of a solid

Volume and outside surface of the common solids. A cylinder or cone takes a diameter and a height; a sphere takes only the diameter; a box takes all three.

cylinder V = π d² h / 4, sphere V = π d³ / 6, cone V = π d² h / 12, box V = a b c

Polar and X Y coordinates

Turns a radius and an angle into X and Y, or X and Y into a radius and an angle. Angles are measured from the X direction, counterclockwise.

x = r cos θ, y = r sin θ, r = √(x² + y²), θ = atan2(y, x)

Distance and angle between two points

The straight-line distance from one X Y point to another, and the angle of that line from the X direction.

distance = √((x2 - x1)² + (y2 - y1)²), angle = atan2(y2 - y1, x2 - x1)

Spacing of holes on a circle

The straight-line distance between neighboring holes spaced evenly on a bolt circle, for checking with calipers or pins.

spacing = D sin(180° / n)

True position from X and Y error

The position of a hole as a diameter zone, from how far its measured center is off in X and in Y. Compare it with the position tolerance on the print.

position = 2 √(dx² + dy²)

Thread mill calculator

Pick a thread (inch, metric, or a taper pipe thread) and get its numbers: the diameters to cut before threading, the largest cutter that fits, the circle the tool center runs on, the feed to program at the tool center so the teeth see the chip load you want, and the time for one pass. Or leave it on Custom and type the size. An internal thread slows the center feed; an external thread speeds it up.

tooth feed = rpm x teeth x chip load. Internal: path = D - cutter, center feed = tooth feed x (D - cutter) / D. External: path = minor + cutter, center feed = tooth feed x (minor + cutter) / minor. Z per circle = 1 / n. Taper pipe: the diameter changes 1/16 in for each inch of depth

Tap drill for a standard thread

Pick a thread and the percent of thread you want: it gives the standard drill nearest that size and the percent of thread that drill really leaves.

inch: drill = D - 0.01299 x percent / n, then the nearest standard drill. metric: drill = D - 1.0825 x pitch x percent / 100

Nearest drill to a size

Finds the standard number, letter or fraction drill closest to a decimal size, with the next one under and over.

closest of the number, letter and 64th-inch fraction drills

Unit converter

The conversions that come up most between inch and metric prints.

1 in = 25.4 mm, 1 psi = 0.006895 MPa, 1 lbf = 4.448 N, 1 ft·lbf = 1.356 N·m, 1 hp = 0.7457 kW

Dose by body weight

The dose for one patient from an order written per kilogram. Pick the unit the order is written in.

dose = weight in kg × amount per kg; 1 lb = 0.4536 kg; 1 mg = 1000 mcg

Volume to draw up

Desired over have: how much liquid holds the ordered amount. The order and the label can be in different units: micrograms ordered from a vial marked in milligrams is worked out for you.

volume = ordered amount ÷ amount on hand × the volume it comes in, with both amounts first put in the same unit

Tablets for a dose

How many tablets or capsules make up the ordered amount, whatever unit each is written in.

tablets = ordered amount ÷ strength of one tablet, with both first put in the same unit

Infusion: dose to pump rate

An ordered rate, in whatever unit it is written, turned into mL an hour for the bag in hand. Weight is only used when the order is per kilogram.

mL/hr = amount needed each hour ÷ amount in each mL of the bag

Infusion: pump rate to dose

The other way round: what dose a running pump rate is giving, in the unit you pick.

dose = mL/hr × amount in each mL of the bag, then per kilogram and per minute as the unit asks

Dose by body surface area

The dose from an order written per square meter. Pick the unit the order is written in.

dose = amount per m² × body surface area

Micrograms, milligrams and grams

One amount in all three weight units, side by side.

1 g = 1000 mg; 1 mg = 1000 mcg

IV flow rate and drip rate

A volume over a time, as a pump rate and as drops a minute for gravity tubing.

mL/hr = volume ÷ hours; drops/min = volume × drop factor ÷ minutes

Body surface area

Surface area from height and weight, by the two formulas most often used.

Mosteller: √(cm × kg ÷ 3600); DuBois: 0.007184 × kg^0.425 × cm^0.725

Ideal and adjusted body weight

The Devine ideal weight for a height, and the adjusted weight used when the actual weight is well above it.

Devine: 50 kg (male) or 45.5 kg (female) + 2.3 kg for each inch over 60; adjusted = ideal + 0.4 × (actual − ideal)

Creatinine clearance (Cockcroft-Gault)

The estimate of kidney clearance that many dosing tables are written against.

(140 − age) × kg ÷ (72 × serum creatinine), × 0.85 for a female

Percent and ratio strength

What a percent strength or a ratio such as 1:1000 means in milligrams per milliliter.

1 percent = 1 g in 100 mL = 10 mg/mL; 1:N = 1 g in N mL = 1000 ÷ N mg/mL

Time left on an infusion

How long what is left in the bag or syringe lasts at the running rate.

time = volume left ÷ rate

Clinical unit converter

The conversions that sit between a scale, a label and an order.

1 lb = 0.4536 kg, 1 mg = 1000 mcg, 1 in = 2.54 cm, 1 fl oz = 29.57 mL, 1 tsp = 5 mL

ECMO flow by body weight

Blood flow for a target written in milliliters per kilogram per minute. The target is yours to enter.

flow in L/min = weight in kg × mL/kg/min ÷ 1000

ECMO flow by body surface area

Blood flow for a target index in liters per minute per square meter, with the surface area worked from height and weight.

body surface area = √(cm × kg ÷ 3600); flow = index × body surface area

Running flow as a share of the target

How the flow on the console compares with the full flow worked from the target index.

share = running flow ÷ (index × body surface area)

Oxygen content of blood

The oxygen carried in each deciliter: what is bound to hemoglobin plus the small part dissolved.

content = 1.34 × hemoglobin × saturation + 0.003 × oxygen pressure

Oxygen delivery

The oxygen a blood flow carries each minute, and the same indexed to body surface area.

delivery in mL/min = flow in L/min × oxygen content × 10

Oxygen transfer across the membrane

The oxygen the membrane lung adds each minute, from blood sampled before and after it.

transfer in mL/min = flow in L/min × (content after − content before) × 10

Recirculation fraction

On veno-venous support: the share of returned blood drawn straight back into the drainage line.

recirculation = (saturation before the membrane − mixed venous) ÷ (saturation after the membrane − mixed venous)

Sweep gas to blood flow ratio

The sweep gas flow set against the blood flow, as a ratio and the other way round.

ratio = sweep gas flow ÷ blood flow; sweep = ratio × blood flow

Dilution from the circuit prime

The hematocrit to expect once a clear prime mixes with the patient's blood. The blood volume per kilogram is yours to enter.

hematocrit after = hematocrit × blood volume ÷ (blood volume + prime volume)

Molar mass of a formula

The mass of one mole, and how much of it each element makes up. Brackets and hydrates work: Ca(OH)2, CuSO4·5H2O.

molar mass = the atomic weight of every atom in the formula, added up

Grams, moles and particles

The mol calculator: one amount of a substance, three ways.

moles = grams ÷ molar mass; particles = moles × 6.022 × 10^23

Molarity of a mix

The strength of a mix in moles per liter, from the mass dissolved and the final volume.

molarity = (grams ÷ molar mass) ÷ liters; grams needed = molarity × liters × molar mass

Dilution

How much of a strong stock to measure out, and how much to add, for a weaker mix. Any strength unit works if it is the same for both.

strength 1 × volume 1 = strength 2 × volume 2

Ideal gas law

The moles of gas in a volume, and the room one mole takes up, at a pressure and temperature.

P × V = n × R × T, R = 0.082057 L·atm/(mol·K), K = °C + 273.15

Balance an equation

The smallest whole numbers that leave every element equal on both sides. Numbers already in front are ignored and worked out again.

one equation an element, solved exactly in whole-number fractions

Stoichiometry: masses in a reaction

Give the equation and the mass of any one substance in it. The equation is balanced for you, and every other mass follows.

moles = grams ÷ molar mass; the balanced numbers set the mole ratio; grams = moles × molar mass

Percent yield

What a reaction really made against what the equation says it could.

percent yield = actual ÷ theoretical × 100

Pace from a race time

The pace a finishing time works out to, for the mile and the kilometer, with the speed.

pace = time ÷ distance; 1 mile = 1609.344 m

Finish time from a pace

What a steady pace per mile comes to at the line.

time = pace per mile × distance in miles

Even split times for a goal

The clock at every mark on the way to a goal time, run at an even pace. For a course, pick miles or kilometers; for the track, laps.

split at a mark = goal time × distance to the mark ÷ race distance

Negative split plan

A goal time run with the second half faster than the first by a set amount.

first half = (goal + difference) ÷ 2; second half = (goal − difference) ÷ 2

Predict a time at another distance

A recent race, carried to another distance by the Riegel rule. A guide, not a promise: it assumes the training for the new distance.

new time = known time × (new distance ÷ known distance)^1.06

Cross country team score

Score a meet from the order of finish. Type each runner's team in the order they crossed the line. Five score, seven count, and teams short of five are taken out first.

team score = the places of its first five finishers, added; low score wins; a tie goes to the better sixth runner

Team score from places

One team's score when you already have its runners' places. The first five count.

score = the five lowest places, added; a perfect score is 1 + 2 + 3 + 4 + 5 = 15

Pack time and one to five spread

A team's times: the average of its first five, and how far its fifth runner is behind its first.

spread = fifth time − first time; average = the first five, added, ÷ 5

Pace per mile and per kilometer

One pace, both ways, with the speed a treadmill would show.

pace per kilometer = pace per mile ÷ 1.609344

Winning percentage and games behind

A record as a percentage, and how far it sits behind the leader's.

percentage = (wins + ties ÷ 2) ÷ games; games behind = ((leader wins − wins) + (losses − leader losses)) ÷ 2

Batting average, on-base and slugging

The three hitting lines from a box score.

average = hits ÷ at bats; on-base = (hits + walks + hit by pitch) ÷ (at bats + walks + hit by pitch + sacrifice flies); slugging = total bases ÷ at bats

Earned run average and WHIP

A pitcher's line. Type a third of an inning as .1 and two thirds as .2, the way a box score does.

ERA = earned runs × game length ÷ innings; WHIP = (walks + hits) ÷ innings

Shooting percentages

Basketball shooting from made and attempted, with the two lines that weigh the three-pointer and the free throw.

effective = (made + 0.5 × threes made) ÷ attempts; true shooting = points ÷ (2 × (attempts + 0.44 × free throw attempts))

Passer rating

The professional passer rating, the one that tops out at 158.3.

four parts, each held between 0 and 2.375: completions, yards, touchdowns and interceptions for each attempt; rating = their sum ÷ 6 × 100

Expected record from scoring

The winning percentage a team's points for and against point to, and the record that goes with it.

expected percentage = for^n ÷ (for^n + against^n); n is about 1.83 for baseball, 2.37 for football, 14 for basketball

RPE calculator

From a set you did (weight, reps and how hard it was) to an estimated one-rep max, and from there to the weight for the set you want next. RPE 10 is nothing left; 9 is one more rep in the tank; 8 is two.

one-rep max = weight ÷ the table's share for those reps at that RPE; next weight = one-rep max × the share for the target set

One-rep max estimate

What a set to near failure points to for a single, by the three formulas most often quoted. They agree best under about 10 reps.

Epley: weight × (1 + reps ÷ 30); Brzycki: weight × 36 ÷ (37 − reps); Lombardi: weight × reps^0.10

Percent of max chart

The working weights for a one-rep max, in steps of five percent.

weight = one-rep max × percent ÷ 100, rounded to the plates on hand

Barbell plate loading

Which plates go on each side of the bar for a target weight.

each side = (target − bar) ÷ 2, made up from the largest plates down

Training volume

The total weight moved in a block of sets, and the average weight a rep.

volume = sets × reps × weight

DOTS score

A powerlifting total set against body weight, so lifters of different sizes can be compared. Both in kilograms.

DOTS = total × 500 ÷ (a + b × bw + c × bw² + d × bw³ + e × bw⁴), with one set of five numbers for men and one for women

Heart rate training zones

An estimated top heart rate from age, and the five training zones worked from the reserve between resting and top (the Karvonen method).

top rate = 220 − age (or 208 − 0.7 × age); zone rate = resting + share × (top − resting)

Daily calories

The energy a body uses at rest, by the Mifflin-St Jeor formula, and across a day at an activity level.

at rest = 10 × kg + 6.25 × cm − 5 × age, + 5 (male) or − 161 (female); a day = at rest × activity factor

Calories burned in a workout

A rough count from the kind of work, body weight and time, using the standard activity ratings (METs).

kcal = MET × kg × hours; a MET is the energy used sitting still

Length converter

Type a value and pick its unit; every other unit of length is listed.

each unit is held as its size in one base unit, so any two convert through it

Area converter

Type a value and pick its unit; every other unit of area is listed.

each unit is held as its size in one base unit, so any two convert through it

Volume converter

Type a value and pick its unit; every other unit of volume is listed.

each unit is held as its size in one base unit, so any two convert through it

Mass and weight converter

Type a value and pick its unit; every other unit of mass and weight is listed.

each unit is held as its size in one base unit, so any two convert through it

Force and thrust converter

Type a value and pick its unit; every other unit of force and thrust is listed.

each unit is held as its size in one base unit, so any two convert through it

Pressure and stress converter

Type a value and pick its unit; every other unit of pressure and stress is listed.

each unit is held as its size in one base unit, so any two convert through it

Torque converter

Type a value and pick its unit; every other unit of torque is listed.

each unit is held as its size in one base unit, so any two convert through it

Energy and work converter

Type a value and pick its unit; every other unit of energy and work is listed.

each unit is held as its size in one base unit, so any two convert through it

Power converter

Type a value and pick its unit; every other unit of power is listed.

each unit is held as its size in one base unit, so any two convert through it

Speed and feed rate converter

Type a value and pick its unit; every other unit of speed and feed rate is listed.

each unit is held as its size in one base unit, so any two convert through it

Flow rate converter

Type a value and pick its unit; every other unit of flow rate is listed.

each unit is held as its size in one base unit, so any two convert through it

Density converter

Type a value and pick its unit; every other unit of density is listed.

each unit is held as its size in one base unit, so any two convert through it

Acceleration converter

Type a value and pick its unit; every other unit of acceleration is listed.

each unit is held as its size in one base unit, so any two convert through it

Angle converter

Type a value and pick its unit; every other unit of angle is listed.

each unit is held as its size in one base unit, so any two convert through it

Time converter

Type a value and pick its unit; every other unit of time is listed.

each unit is held as its size in one base unit, so any two convert through it

Computer data converter

Type a value and pick its unit; every other unit of computer data is listed.

each unit is held as its size in one base unit, so any two convert through it

Temperature converter

Type a temperature and pick its scale; the other three are listed.

°C = (°F − 32) × 5 ÷ 9; K = °C + 273.15; °R = °F + 459.67

Fuel economy converter

Miles per gallon and liters per 100 kilometers run opposite ways: one goes up as the other comes down.

L/100 km = 235.2146 ÷ US mpg; km/L = US mpg × 0.425144

Medication lookup: open the official label

Type any medication, generic or brand. The links open its official FDA label on DailyMed (description, what it is for, contraindications, boxed warnings, adverse reactions, dosing) and the plain-language page on MedlinePlus. Both are run by the U.S. National Library of Medicine. This page does not write its own drug facts: the label is the source.

nothing is worked out here: the links carry the name you typed to the source's own search

Energy of light: one photon

The energy carried by one photon of light, from its wavelength, its frequency or its energy. Green light is about 532 nm.

E = h × f = h × c ÷ wavelength; h = 6.626 × 10^-34 J·s; c = 299,792,458 m/s; 1 eV = 1.602 × 10^-19 J

Energy in a beam of light

How much energy a light source or laser delivers in a time, and how many photons that is.

energy = power × time; photons = energy ÷ (h × c ÷ wavelength)

Mass and energy: E = mc²

The energy locked in a mass, if all of it were turned to energy.

E = m × c²; c = 299,792,458 m/s

Heat radiated by a hot surface

The power a hot surface gives off as light and heat, and the wavelength where its glow peaks.

power = emissivity × 5.670 × 10^-8 × area × T⁴ (T in kelvin); peak wavelength = 2.898 × 10^-3 ÷ T

Light intensity at a distance

How the intensity of light from a small source falls off as you move away.

intensity = power ÷ (4 × π × distance²)

Refraction: Snell's law

How far a ray bends going from one clear material into another. Air is 1.000, water 1.333, glass about 1.52.

n1 × sin(angle 1) = n2 × sin(angle 2); critical angle = asin(n2 ÷ n1) when n1 is the larger

Wavelength and frequency of a wave

For sound, light or radio: one of wavelength and frequency from the other. Sound in air at room temperature travels about 343 m/s; light, 299,792,458 m/s.

speed = frequency × wavelength; period = 1 ÷ frequency

Kinetic energy

The energy of something moving, and its momentum.

energy = ½ × mass × speed²; momentum = mass × speed

Free fall and potential energy

A drop from a height with no air in the way: how long it takes, how fast it lands, and the energy it carries.

time = √(2 × height ÷ g); speed = √(2 × g × height); energy = mass × g × height; g = 9.80665 m/s²

Projectile motion

Where something launched at an angle lands, with no air in the way.

time = (v·sin + √((v·sin)² + 2·g·h)) ÷ g; range = v·cos × time; top = h + (v·sin)² ÷ (2·g)

Force, mass and acceleration

Newton's second law, and what a mass weighs.

force = mass × acceleration; weight = mass × g

Work and power

The work done pushing or lifting, and the power it takes to do it in a given time.

work = force × distance; power = work ÷ time; 1 hp = 550 ft·lbf/s

Ohm's law and electrical power

Give any two of volts, amps, ohms and watts; the other two follow.

V = I × R; P = V × I = I² × R = V² ÷ R

Pendulum period

How long one full swing takes, for a small swing.

period = 2 × π × √(length ÷ g)

Gravity between two masses

The pull between any two masses. The defaults are the Earth and a 1 kg mass at its surface.

force = G × m1 × m2 ÷ distance²; G = 6.6743 × 10^-11

Bernoulli's equation

Along a smooth flow, pressure, speed and height trade off. Give the pressure, speed and height at one point and the speed and height at another; the pressure there follows. Steady flow, no friction, and a fluid that does not compress (air is fine below about 200 mph).

p1 + ½·ρ·v1² + ρ·g·z1 = p2 + ½·ρ·v2² + ρ·g·z2

Dynamic pressure

The pressure a moving fluid would add if brought to rest: the push of a wind or a stream.

q = ½ × ρ × v²

Speed from a pressure difference (pitot tube)

The flow speed that a pitot tube's pressure difference stands for.

v = √(2 × Δp ÷ ρ)

Continuity: speed through a change of size

What goes in comes out: a narrower pipe runs faster. For a fluid that does not compress.

area 1 × speed 1 = area 2 × speed 2; flow = area × speed

Venturi flow meter

The flow through a venturi from the pressure drop between the inlet and the throat. Bernoulli and continuity together.

flow = Cd × throat area × √(2 × Δp ÷ (ρ × (1 − (throat ÷ inlet diameter)⁴)))

Flow through an orifice

The flow through a sharp hole or orifice plate from the pressure across it. 0.61 is the usual coefficient for a sharp edge. For a gas, good only for small pressure drops.

Q = Cd × A × √(2 × Δp ÷ ρ)

Draining a tank (Torricelli)

How fast liquid leaves a hole below the surface of an open tank.

v = √(2 × g × head); flow = Cd × hole area × v

Pressure from depth

The pressure a column of liquid makes at its bottom, over and above what is on its surface.

pressure = ρ × g × depth

Reynolds number

Whether a flow in a pipe is smooth (laminar) or churning (turbulent).

Re = speed × diameter ÷ kinematic viscosity; laminar under about 2,300, turbulent over about 4,000

Pressure drop in a pipe (Darcy-Weisbach)

The pressure lost to friction along a straight pipe. The friction factor is worked out for you from the Reynolds number and the roughness of the wall (0.00006 in for drawn tube, 0.0018 in for commercial steel).

Δp = f × (L ÷ D) × ½ × ρ × v²; f = 64 ÷ Re when laminar, else Swamee-Jain: 0.25 ÷ log10(ε ÷ (3.7·D) + 5.74 ÷ Re^0.9)²

Air density

The density of dry air at a pressure and temperature.

density = pressure ÷ (287.05 × T), T in kelvin, pressure in pascals

Standard atmosphere at altitude

The pressure, temperature and density of the standard atmosphere at a height above sea level, up to 36,000 ft.

T = 288.15 − 0.0065 × h; p = 101,325 × (T ÷ 288.15)^5.25588; density = p ÷ (287.05 × T) (h in meters)

Speed of sound and Mach number

The speed of sound in air at a temperature, and how a speed compares with it.

speed of sound = √(1.4 × 287.05 × T), T in kelvin; Mach = speed ÷ speed of sound

Lift and drag force

The force of air or water on a body, from its coefficient and area. A flat plate face-on is about 1.2; a modern car about 0.3.

force = ½ × ρ × v² × area × coefficient

Two-stroke mix: oil to gas

How much oil to add to an amount of gas for a mix ratio, with the common ratios listed beside it.

oil = gas ÷ ratio; 1 US gallon = 128 fl oz = 3,785 mL

Fuel for a trip

The fuel a trip takes, and how far a tank goes.

fuel = distance ÷ miles per gallon; range = tank × miles per gallon

Fuel economy from a fill-up

Miles per gallon from the distance driven and the fuel it took.

mpg = miles ÷ gallons; L/100 km = 235.21 ÷ mpg

Coolant mix

How much concentrate and how much water fill a cooling system at a given strength.

concentrate = capacity × percent ÷ 100; water = the rest

Engine displacement

The swept volume of an engine from its bore, stroke and number of cylinders.

displacement = π ÷ 4 × bore² × stroke × cylinders

Compression ratio

Static compression ratio from the cylinder and everything above the piston at the top of its stroke. Enter a dish as a plus number and a dome as a minus.

ratio = (swept volume + clearance volume) ÷ clearance volume; clearance = chamber + gasket + deck + dish

Horsepower and torque

Horsepower from torque and engine speed, or torque from horsepower.

hp = torque × rpm ÷ 5,252; torque = hp × 5,252 ÷ rpm

Road speed from engine speed

How fast the car is going at an engine speed in a gear.

mph = rpm × tire diameter ÷ (gear ratio × axle ratio × 336.13)

Tire size

What a metric tire size works out to, and how a change of tire throws off the speedometer.

diameter = rim + 2 × width × aspect ÷ 100 ÷ 25.4; revs a mile = 63,360 ÷ (π × diameter)

Quarter-mile estimate

A rough quarter-mile time and trap speed from power and weight. A rule of thumb for a car that hooks up well; traction, gearing and air change it.

elapsed time = 5.825 × (weight ÷ hp)^(1/3); trap speed = 234 × (hp ÷ weight)^(1/3)

Carburetor or throttle body size

The airflow an engine draws at its top speed, to size a carburetor or throttle body. A street engine fills about 85 percent; a race engine 100 or more.

cfm = cubic inches × rpm × volumetric efficiency ÷ 3,456

Fuel injector size

The injector flow an engine needs for a power level. Fuel use for each horsepower is about 0.50 for a gasoline engine without boost and 0.60 with; 80 percent is the usual limit on how long an injector stays open.

flow each = horsepower × fuel use for each hp ÷ (injectors × duty); cc/min = lb/hr × 10.5

Piston speed

The average speed of the piston at an engine speed.

mean piston speed in ft/min = stroke in inches × rpm ÷ 6

Gear ratio and a tire change

An axle ratio from its tooth counts, and the ratio that puts the engine speed back where it was after a change of tire size.

ratio = ring teeth ÷ pinion teeth; ratio to match = old ratio × new tire ÷ old tire

These are reference calculators. They use textbook formulas, with no safety factor and no code rules built in, and they run in your browser: nothing you type is sent to us. Check every result yourself before you rely on it. The medical tools are math aids, not medical advice. DM Machine and Tool LLC machines parts to your print; we do not offer design or engineering services.

Need the part made? Try our experimental auto quoter, or e-mail the print to info@DmMachinetool.com.