The BDS statistic has proved to be one of several useful nonlinear diagnostics. It has been shown to have good power against many nonlinear alternatives, and its asymptotic properties as a residual diagnostic are well understood. Furthermore, extensive Monte Carlo results have proved it useful in relatively small samples. However, the BDS test is not trivial to calculate, and is even more difficult to deal with if one wants the speed necessary to make bootstrap resampling feasible. This short paper presents a fast algorithm for the BDS statistic, and outlines how these speed improvements are achieved. Source code in the C programming language is included. Early research into time-series analysis of chaotic systems led to several key insights. Most important was the fact that the standard toolbox of linear diagnostics needed to be extended, since many of these tests could be easily fooled into seeing randomness where rich nonlinear structures existed. The impact of these findings for modern time-series analysis has been significant, and most toolboxes now in use contain several different diagnostics for detecting potential nonlinearities.1 The BDS test, which was introduced in working paper form in the mid-1980s and published in Brock, Dechert, Scheinkman, and LeBaron (1996), has proved a very useful test in terms of size and power, and has been used in many nonlinear time-series studies. Also, extensive Monte-Carlo studies carried out in Brock, Hsieh, and LeBaron (1991) have shown that its small sample properties are quite good. Despite all these favorable features, the BDS test does have one drawback: it is not a trivial statistic to calculate. Easy-to-use code written for DOS-based computers was provided by W. D. Dechert, and later C code was provided by B. LeBaron. The Dechert code is very user-friendly, whereas the C source code uses a more complicated, but faster, algorithm. Also, as a C subroutine, it can be worked into the user's code, and extended for other purposes. This paper describes the algorithms used in this C code version. The goals of this paper are to describe the BDS algorithms for the first time. It is hoped that this will both help new users, and also encourage those who would like to enhance, extend, and incorporate some of these methods in their own programs. The paper is in four short sections. After this introduction, the second section defines the BDS test and its asymptotic distribution properties. The third goes through the BDS algorithm, and the fourth concludes and suggests various extensions and modifications. 1Barnett et al. (forthcoming) provide a useful summary and comparison of many of these tests.