FirmGod

I²C Pull-Up Resistor Calculator

Find the pull-up window for an I²C bus from the supply, bus capacitance and mode. Both limits from the spec, with the standard values that fit between.

Rise budget 300 ns

Volts. The pull-ups go to this rail.

Picofarads, total on one line.

Milliamps, from the weakest device on the bus.

Volts. V_OL from the datasheet.

±5% parts

The usual choice. The rise-time budget is a third of Standard-mode, so capacitance starts to matter.

The window

966.7 Ω – 3.54k Ω · use 1.8k Ω
rise 153 ns (51% of budget) — sinks 1.61 mA (54% of rating)
Minimum — device must pull the line low966.7 Ω
Maximum — line must rise in time3.54k Ω
Spread3.7×

Standard values that fit

A smaller resistor rises faster and burns more current; a larger one does the opposite. The recommended value sits at the geometric middle, the same factor from either limit.

ResistorRise timeBudget usedSink currentPower (line low)
1k Ωtight84.7 ns28%2.9 mA (97%)8.41 mW
1.1k Ω93.2 ns31%2.64 mA (88%)7.65 mW
1.2k Ω102 ns34%2.42 mA (81%)7.01 mW
1.3k Ω110 ns37%2.23 mA (74%)6.47 mW
1.5k Ω127 ns42%1.93 mA (64%)5.61 mW
1.6k Ω136 ns45%1.81 mA (60%)5.26 mW
1.8k Ωrecommended153 ns51%1.61 mA (54%)4.67 mW
2k Ω169 ns56%1.45 mA (48%)4.21 mW
2.2k Ω186 ns62%1.32 mA (44%)3.82 mW
2.4k Ω203 ns68%1.21 mA (40%)3.5 mW
2.7k Ω229 ns76%1.07 mA (36%)3.11 mW
3k Ω254 ns85%967 µA (32%)2.8 mW
3.3k Ω280 ns93%879 µA (29%)2.55 mW

Values marked tight fall outside the window once the series tolerance is applied, so a part at the wrong end of its spread stops meeting one of the two limits.

Why the value is a window, not a number

SDA and SCL are open-drain. A device can pull a line down, but nothing drives it up — the rise is a resistor charging whatever capacitance is hanging on the bus. That puts the pull-up between two limits that come from opposite directions, and both are written into the I²C specification.

Make the resistor too small and the device cannot pull the line low enough. Each device guarantees a low level only up to a stated sink current, and below that resistance the low sits aboveV_OL and stops reading as a zero.

Make it too large and the rise is too slow. The line has to cross from 0.3·VDD to 0.7·VDD inside the mode's budget, and an RC edge that misses it gives a bus that works on the bench and fails on a longer cable or with one more device fitted.

The two formulas

LimitFormulaSet by
MinimumRp(min) = (VDD − V_OL) / I_OLWhat the weakest device can sink
MaximumRp(max) = tr / (0.8473 × Cb)Rise-time budget and bus capacitance

The 0.8473 is not a fudge factor. An RC edge takes RC · ln(0.7/0.3) to cross the two thresholds, and ln(0.7/0.3) = 0.8473. VDD cancels, which is why a higher supply buys no rise-time headroom.

What the specification says per mode

ModeRise budgetMax CbSink current
Standard-mode, 100 kHz1000 ns400 pF3 mA
Fast-mode, 400 kHz300 ns400 pF3 mA
Fast-mode Plus, 1 MHz120 ns550 pF20 mA

High-speed mode is absent deliberately: it switches in an active current-source pull-up during transfers, so "what resistor" is not the question being asked.

A worked example

A 3.3 V Fast-mode bus with 100 pF of capacitance and ordinary 3 mA devices:

Rp(min) = (3.3 − 0.4) / 0.003 = 967 Ω
Rp(max) = 300 ns / (0.8473 × 100 pF) = 3.54 kΩ

So anything from about 1 kΩ to 3.5 kΩ is legal, and the familiar 4.7 kΩ is outside it. That is the single most common way this goes wrong: a value that was fine at 100 kHz is carried into a 400 kHz design without rechecking, and the bus works until the cable gets longer.

Estimating bus capacitance

Cb is the total on one line: every device's input capacitance plus the interconnect. Rough figures to start from, to be replaced by datasheet numbers where they matter:

  • Device input — 5 to 10 pF each, on the datasheet as Ci.
  • PCB trace — roughly 1 pF per centimetre.
  • Ribbon or flat cable — roughly 50 pF per metre per conductor, which is what makes off-board I²C runs difficult far sooner than people expect.

If the estimate is load-bearing, measure instead. Fit a known resistor, look at the rise on a scope, and invert the formula: Cb = tr / (0.8473 × Rp). That also catches capacitance nobody counted.

Why the middle of the window

The two limits are a ratio, not a range with a natural centre. A value at the geometric middle,√(Rmin · Rmax), sits the same factor away from failing to pull low as it does from rising too slowly, so whichever assumption turns out to be optimistic has the same margin behind it. The arithmetic middle leans toward the upper limit, which is the one that capacitance you forgot to count will erode.

When the window's spread is under about 2×, the real answer is usually that the bus needs changing rather than the resistor: fewer devices, a shorter run, a bus buffer, or a slower mode.

Things that quietly break a working bus

  • Pull-ups on more than one board. Two modules each fitted with 4.7 kΩ give 2.35 kΩ. Add a third and the parallel value can fall under the minimum, at which point the weakest device can no longer pull the line low. Breakout boards ship with pull-ups fitted far more often than not.
  • Mixed supply rails. Pull-ups must go to the lowest VDD on the bus, or a 1.8 V device sees 3.3 V on its pin. Where the rails genuinely differ, the answer is a level translator, not a resistor.
  • Raising the clock later. Moving from 100 kHz to 400 kHz cuts the rise budget to a third, and a resistor chosen for the slower mode is often out of range at the faster one.
  • Counting only the devices. The connector, the cable, and a long trace are usually a bigger share of Cb than the chips are.

Frequently asked questions

Why is 4.7 kΩ the value everyone uses?

It sits comfortably inside the window for a short Standard-mode bus at 5 V, which is what most early examples were, and it has been copied forward ever since. At 400 kHz with any real amount of capacitance it is often above the upper limit. It is a reasonable first guess and a poor substitute for the two-line calculation.

How do I know my bus capacitance?

Add the Ci of every device from its datasheet — typically 5 to 10 pF each — then the trace or cable. A short PCB trace is around 1 pF per centimetre; ribbon cable is closer to 50 pF per metre per conductor. If the number matters, measure the rise time on a scope and work backwards: Cb = tr / (0.8473 × Rp).

Should I put pull-ups on every board?

No. Pull-ups belong at one place on the bus, usually beside the controller. Two boards that each fit their own 4.7 kΩ end up with 2.35 kΩ in parallel, which may fall below the minimum and stop the weakest device pulling the line low. Modules with pull-ups fitted are the usual cause.

Does a higher supply voltage help the rise time?

No, and this surprises people. The thresholds are 0.3 and 0.7 of VDD, so the supply cancels out of tr = 0.8473 × Rp × Cb. Raising VDD does raise the minimum resistor, because the device has to sink more current to hold the line low.

What about Fast-mode Plus at 1 MHz?

It assumes every device on the bus can sink 20 mA, not the 3 mA of the slower modes, which is what makes the smaller resistors it needs legal. Check that rating on each part before selecting the mode — one 3 mA device sets the minimum for the whole bus.

The code behind this

The arithmetic on this page is published as the i2cpullup module — the same functions you are using here, with the same tests. MIT, no dependencies.

Read the sourceOn npmnpm i electronics-math