Getting the Period Right Without Overthinking It
The formula for oscillation period changes depending on what physical system you are dealing with. I have seen people try to use the same expression for a pendulum and a spring and wonder why the numbers come out wrong. Start by identifying the type of oscillator. That decision determines everything else. For a simple pendulum, the period is T equals two pi times the square root of length divided by gravitational acceleration. T = 2(L/g). This assumes small angles, meaning the amplitude stays below roughly ten degrees. Beyond that, the relationship stops being linear and your result drifts. A spring-mass system follows T = 2(m/k), where m is the oscillating mass and k is the spring constant. These two expressions look similar but describe completely different physics, and mixing them is the most common error I encounter in forum posts and lab reports.
Formula For Oscillation Period in Real Systems
Here is the part that usually gets glossed over. The simple formulas assume ideal conditions. In practice, you will run into distributed mass in the spring, air resistance, friction at pivot points, and finite amplitude effects. When I was calibrating a timing rig for a university lab experiment involving a vertical spring with a steel mass, I kept getting periods that were about three percent too long compared to the prediction from T = 2(m/k). The source turned out to be the effective mass of the spring itself. A real spring contributes roughly one third of its mass to the oscillating system. Once I adjusted the mass term to m plus one third of the spring mass, the measured period matched the calculation within experimental error. Without that correction, the discrepancy grows with heavier springs and lighter attached masses. Another thing people miss is that damping does not significantly change the period of an underdamped system. The damped period is T_d = 2/(² - ²), where is the natural angular frequency and is the damping coefficient. For light damping, which covers most mechanical setups you will actually build, the difference between T and T_d is negligible. But once damping becomes moderate, that difference starts to matter and you need to measure it directly rather than relying on the undamped formula. For an LC circuit, the formula switches entirely. The period is T = 2(LC). This has no direct mechanical analogy in terms of mass and gravity, even though the mathematics is isomorphic. I once saw someone try to measure the period of a high-Q tank circuit using a stopwatch. Do not do that. The periods are in the millisecond range and human reaction time introduces errors larger than the period itself. Use an oscilloscope or a frequency counter instead.
The pendulum formula also breaks down when the amplitude exceeds about fifteen degrees. The correction factor involves an infinite series, but a practical approximation is to multiply the small-angle result by 1 plus one sixteenth of the amplitude squared in radians. If your pendulum swings at twenty degrees peak-to-peak, the uncorrected formula underestimates the period by roughly one percent. That sounds small until you are trying to verify g to three significant figures. One more practical note. The period of a simple pendulum is independent of mass. This is counter-intuitive for most people because heavier objects fall faster in everyday experience due to air resistance. In a vacuum or at low speeds where drag is negligible, a heavy bob and a light bob of the same size and shape will oscillate at the same rate. I have heard students insist the formula must include mass because it feels like it should. It does not, and that is a feature of the physics, not a flaw in the derivation. If you are working with a physical pendulum rather than a simple one, the formula becomes T = 2(I/mgd), where I is the moment of inertia about the pivot, m is the total mass, g is gravitational acceleration, and d is the distance from the pivot to the center of mass. This covers anything that is not a point mass on a massless string. A uniform rod pivoted at one end has I equal to one third mL squared and d equal to L over two, which gives T = 2(2L/3g). The simple pendulum formula applied to the same rod would give the wrong answer by a factor of roughly 0.82.
Get the Full Details

I should also mention that the formulas above assume constant gravitational acceleration. If you are doing precision work at different altitudes or latitudes, g varies enough to matter. At the equator g is about 9.78 meters per second squared. At the poles it is about 9.83. That five percent difference in g translates directly into a roughly two and a half percent difference in the calculated period. For field work or teaching labs, using a local value for g rather than the standard 9.80665 improves accuracy noticeably. When the system is not linear, none of these formulas apply. A pendulum with large amplitude, a spring that stiffens or softens with displacement, or any oscillator with nonlinear restoring forces requires numerical integration or experimental measurement. There is no closed-form algebraic expression that covers those cases accurately. Trying to force one of the standard formulas into a nonlinear regime produces results that look plausible but are wrong, and the error grows with amplitude or stiffness variation. Measure directly in those cases. Use a motion sensor, a photogate, or video analysis rather than relying on equations that assume linearity.