The Tutte polynomial is a fundamental invariant of graphs. In this article, we define and study a generalization of the Tutte polynomial for directed graphs, that we name the B-polynomial. The B-polynomial has three variables, but when specialized to the case of graphs (that is, digraphs where arcs come in pairs with opposite directions), one of the variables becomes redundant and the B-polynomial is equivalent to the Tutte polynomial. We explore various properties, expansions, specializations, and generalizations of the B-polynomial, and try to answer the following questions:• what properties of the digraph can be detected from its B-polynomial (acyclicity, length of directed paths, number of strongly connected components, etc.)? • which of the marvelous properties of the Tutte polynomial carry over to the directed graph setting? The B-polynomial generalizes the strict chromatic polynomial of mixed graphs introduced by Beck, Bogart and Pham. We also consider a quasisymmetric function version of the B-polynomial which simultaneously generalizes the Tutte symmetric function of Stanley and the quasisymmetric chromatic function of Shareshian and Wachs.