Pull-up resistor calculator
For a 3.3 V I²C bus at 100 kHz with a typical 100 pF of capacitance, anything from about 1 kΩ to 20 kΩ works, and 4.7 kΩ sits comfortably in the middle of that window. It is the default because it is right often enough. Push the bus to 400 kHz or add more devices and the upper limit collapses — which is when a bus that worked at 100 kHz mysteriously stops at 400.
A pull-up has two limits. The minimum is set by how much current the driver can sink: Vcc divided by the sink current. The maximum is set by rise time — the resistor and bus capacitance must charge the line within about 30% of a bit period. For a 3.3 V 400 kHz bus at 100 pF, that window is roughly 1.1 kΩ to 5.6 kΩ.
How to choose a pull-up resistor
Pull-up selection is a squeeze between two failures. Too weak and the line rises too slowly, so the receiver samples a level that has not arrived yet — which shows up as intermittent errors that get worse as you add devices or lengthen wires. Too strong and the open-drain driver cannot pull the line low enough to register as a zero, which fails hard and immediately. The window between them narrows as bus speed rises and as capacitance grows, which is why a long I²C bus with many devices is genuinely difficult and why active bus buffers exist.
Questions
4.7 kΩ is the usual default for 100 kHz. At 400 kHz or with a long bus you may need 2.2 kΩ or lower.