We present an accurate ab initio tight-binding Hamiltonian for the transition metal dichalcogenides, MoS2, MoSe2, WS2, WSe2, with a minimal basis (the d orbitals for the metal atoms and p orbitals for the chalcogen atoms) based on a transformation of theKohn-Sham density functional theory Hamiltonian to a basis of maximally localized Wannier functions. The truncated tight-binding Hamiltonian, with only on-site, first, and partial second neighbor interactions, including spin-orbit coupling, provides a simple physical picture and the symmetry of the main band-structure features. Interlayer interactions between adjacent layers are modeled by transferable hopping terms between the chalcogen p orbitals. The full-range tight-binding Hamiltonian can be reduced to hybrid-orbital k . p effective Hamiltonians near the band extrema that capture important low-energy excitations. These ab initio Hamiltonians can serve as the starting point for applications to interacting many-body physics including optical transitions and Berry curvature of bands, of which we give some examples.