This book constitutes the refereed proceedings of the 39th International Conference on Current Trends in Theory and Practice of Computer Science, SOFSEM 2013, held in Špindleruv Mlýn, Czech Republic, in January 2013. The contributions are organized in topical sections named: foundations of computer science;