A nonpositive real matrix A = (a ij ) 1≤i,j≤n is said to be totally nonpositive (negative) if all its minors are nonpositive (negative) and it is abbreviated as t.n.p. (t.n.). In this work a bidiagonal factorization of a nonsingular t.n.p. matrix A is computed and it is stored in an matrix represented by BD (t.n.p.) (A) when a 11 < 0 (or BD (zero) (A) when a 11 = 0). As a converse result, an efficient algorithm to know if an matrix BD (t.n.p.) (A) (BD (zero) (A)) is the bidiagonal factorization of a t.n.p. matrix with a 11 < 0 (a 11 = 0) is given. Similar results are obtained for t.n. matrices using the matrix BD (t.n.) (A), and these characterizations are extended to rectangular t.n.p. (t.n.) matrices. Finally, the bidiagonal factorization of the inverse of a nonsingular t.n.p. (t.n.) matrix A is directly obtained from BD (t.n.p.) (A) (BD (t.n.) (A)).