Error and uncertainty in needle placement can drastically impact the clinical outcome of both diagnostic and therapeutic needle-based procedures. In this work, we aim to estimate the shape of a bent needle during insertion and provide a prototype design of a needle whose deflection is tracked in real time. We calculate slope along a needle by measuring the movement of fixed wires running along its length with a compact image-based sensor. Through the use of the Euler–Bernoulli beam theory, we calculate shape and trajectory of a needle. We constructed a prototype needle with two wires fixed along its length and measured wire-movement using a vertical-cavity surface-emitting laser (VCSEL) mouse sensor. This method was able to estimate needle tip deflection within 1 mm in a variety of deflection scenarios in real time. We then provide a design of a needle with real-time deflection tracking in 3D, providing the user with a simple display to convey needle deflection in tissue. This method could be applied to needle-based biopsy or therapy procedures to improve the diagnostic accuracy or treatment delivery quality.