I2C Pull-Up Resistor Calculator
Find the pull-up resistor for an I2C bus from the supply voltage, the speed mode and the bus capacitance. The calculator gives the allowed window from the I2C-bus specification, Rp(min) from sink current and Rp(max) from rise time, recommends a standard value in the middle of it, and shows the rise time, the sink current and how much capacitance that value supports. It also checks 4.7 kΩ and 10 kΩ against your bus. The inputs live in the URL, so a copied link reproduces the calculation.
- Allowed window
- 967 Ω to 3.54 kΩ
- Rp(min) at 3 mA sink, Rp(max) at 100 pF
- Rise time
- 153 ns
- 49% under the 300 ns limit
- Sink current, line low
- 1.83 mA
- VDD / Rp, the worst case, per line
- Power, line low
- 6.05 mW
- per line, only while it is held low
- Max Cb with this resistor
- 197 pF
- 1.8 kΩ at 400 kHz
- Max Cb with any resistor
- 366 pF
- Fast-mode at 3.3 V, where the window closes
A microcontroller's internal pull-ups (roughly 20 to 50 kΩ) are too weak here: even at 20 kΩ the line would take 1.69 µs to rise, against a 300 ns limit. Fit external resistors.
The two values fitted by habit, checked against these inputs: 4.7 kΩ is too weak (398 ns rise time against the 300 ns limit); 10 kΩ is too weak (847 ns rise time against the 300 ns limit).
The link reproduces these exact inputs - paste it in a design review or a pull request.
Bring the device list, the bus voltage and the cable or board length. We will look at the pull-ups, level shifting, address clashes and the bus topology with you before the board goes to fab. If you need the whole board done, see PCB design and layout services; for the driver side, see firmware development.
I2C speed modes and their limits
Limits from the I2C-bus specification (NXP UM10204, Rev. 7). At 2 V and below the LOW level is specified at 2 mA of sink current in every mode. The last column is the pull-up window each mode gives for your bus voltage and capacitance.
| Mode | Max clock | Rise time tr(max) | Sink current IOL | Cb limit | Window at 3.3 V, 100 pF |
|---|---|---|---|---|---|
| Standard-mode | 100 kHz | 1 µs | 3 mA | 400 pF | 967 Ω to 11.8 kΩ |
| Fast-mode | 400 kHz | 300 ns | 3 mA | 400 pF | 967 Ω to 3.54 kΩ |
| Fast-mode Plus | 1 MHz | 120 ns | 20 mA | 550 pF | 145 Ω to 1.42 kΩ |
The equation
An I2C line is open-drain: devices only ever pull it low, and the pull-up resistor Rp brings it back high. Two limits from the I2C-bus specification (NXP UM10204, section 7.1) bound its value. The lower limit is drive strength. A pin must hold the line at or below VOL(max) while it sinks everything the resistor supplies, so Rp(min) = (VDD - VOL(max)) / IOL. VOL(max) is 0.4 V on a bus above 2 V and 0.2 × VDD at 2 V or below; IOL is 3 mA in Standard-mode and Fast-mode and 20 mA in Fast-mode Plus. The upper limit is speed. The resistor charges the bus capacitance Cb, and the line must climb from 30% to 70% of VDD within the rise time the mode allows. On an RC curve that takes ln(0.7 / 0.3) = 0.8473 time constants, so Rp(max) = tr(max) / (0.8473 × Cb).
Any value between the two is legal. The calculator recommends the standard value nearest the geometric middle of the window, the square root of Rp(min) × Rp(max). That value sits the same factor above the minimum as below the maximum, so it keeps as much margin against a weak driver as against extra capacitance. A battery design can move toward the top of the window to save current; a noisy or long bus can move toward the bottom. Sink current is reported as VDD / Rp, the worst case where a pin pulls the line all the way to 0 V, and power as VDD² / Rp for each line while it is low. An idle bus draws nothing through the pull-ups.
4.7 kΩ is a habit, not an answer
A 4.7 kΩ pull-up reaches the rise-time limit at 251 pF in Standard-mode, at 75.3 pF in Fast-mode and at 30.1 pF in Fast-mode Plus. So it is fine on almost any 100 kHz bus, fine at 400 kHz only on a short board with a few devices, and wrong at 1 MHz. A 10 kΩ pull-up supports 118 pF at 100 kHz and 35.4 pF at 400 kHz. A bus with pull-ups that are too large usually still works on the bench: the edges are slow, the timing margin is gone, and it fails later, when a longer cable or one more device is added.
Estimating and measuring bus capacitance
Cb is everything that hangs on one line: every device pin, the traces, the connectors and any cable. The specification allows a pin up to 10 pF, and a trace or cable adds very roughly 1 pF per cm, so four devices on 10 cm of trace come to about 50 pF and eight devices on 30 cm to about 110 pF. That is a starting point, not a measurement. To measure, fit a known resistor, capture a rising edge on an oscilloscope, read the time from 30% to 70% of VDD and solve Cb = tr / (0.8473 × Rp). Remember that the probe adds around 10 pF of its own.
When the window closes
As capacitance grows, Rp(max) falls until it meets Rp(min), and past that point no resistor satisfies both limits. With 3 mA drivers in Fast-mode that happens at 366 pF on a 3.3 V bus and at 231 pF on a 5 V bus, both below the 400 pF the specification allows; the specification itself notes that driving the full load at 400 kHz takes parts that sink 6 mA. There are three ways out. Run the bus slower: Standard-mode carries 400 pF at 5 V with anything from 1.53 kΩ to 2.95 kΩ. Split the bus with a buffer or multiplexer, so each segment has its own pull-ups and less capacitance. Or add a rise-time accelerator or a switched pull-up. This calculator covers the three open-drain modes: Hs-mode (3.4 MHz) adds a current-source pull-up in the controller, and Ultra Fast-mode is push-pull with no pull-ups at all.
Frequently asked questions
What value pull-up resistor for I2C at 3.3 V?
It depends on the speed and the bus capacitance, but the window is quick to work out. The minimum is (3.3 - 0.4) / 0.003 = 967 Ω. At 400 kHz with 100 pF on the bus the maximum is 300 ns / (0.8473 × 100 pF) = 3.54 kΩ, and the standard value nearest the middle of that window is 1.8 kΩ, which gives a 153 ns rise time against the 300 ns limit. At 100 kHz with the same 100 pF the maximum is 11.8 kΩ and the middle value is 3.3 kΩ; 4.7 kΩ also works there, with a 398 ns rise time against 1000 ns.
Is 4.7k OK for 400 kHz I2C?
Only on a lightly loaded bus. At 400 kHz the rise time must stay under 300 ns, and a 4.7 kΩ pull-up reaches that limit at 75.3 pF. With 50 pF on the bus it rises in 199 ns and passes; with 100 pF it takes 398 ns and is outside the specification, even if the bus seems to work on the bench. For 100 pF use about 1.8 kΩ to 2.2 kΩ: 2.2 kΩ supports up to 161 pF at 400 kHz.
Can I use the internal pull-ups for I2C?
Rarely. A microcontroller's internal pull-ups are roughly 20 to 50 kΩ and loosely toleranced. At 400 kHz a 20 kΩ pull-up supports only 17.7 pF and a 50 kΩ one 7.08 pF, less than the 20 pF that two device pins alone may add. At 100 kHz the figures are 59 pF and 23.6 pF, so one sensor a few centimetres away may work, with no margin you can count on. Fit two external resistors.
What is the minimum pull-up resistor for I2C?
The smallest value that still lets a pin pull the line down to a valid LOW level: (VDD - VOL(max)) / IOL. With the standard 3 mA sink current and the 0.4 V limit that is 967 Ω at 3.3 V and 1.53 kΩ at 5 V. At 1.8 V the specification states the LOW level as 0.2 × VDD at 2 mA, which gives 720 Ω. Fast-mode Plus parts sink 20 mA, so the minimum drops to 145 Ω at 3.3 V and 230 Ω at 5 V, but only if every device on the bus is a Fast-mode Plus part.
What is the maximum bus capacitance for I2C?
The specification allows 400 pF on each line in Standard-mode and Fast-mode and 550 pF in Fast-mode Plus. At 400 kHz the pull-up window closes earlier than that: with 3 mA drivers no resistor meets both the rise-time and the sink-current limit above 366 pF on a 3.3 V bus, or above 231 pF on a 5 V bus. Standard-mode has room to spare: at 5 V and 400 pF any value from 1.53 kΩ to 2.95 kΩ works. Past the limit, split the bus with a buffer or multiplexer, or run it slower.
If the board is the product
Two pull-ups on a short bus are a five-minute decision. A bus that leaves the board on a cable, mixes 1.8 V and 3.3 V devices or carries a dozen sensors is not, and that is our day job: PCB design and layout and firmware development explain how we work. For the rest of the schematic, the RC filter calculator, the crystal load capacitor calculator and the voltage divider calculator are next door. If a number here decides something real, a free 30-minute technical call is the fastest way to check it against someone who has shipped the board.