A tool holder includes a rack and at least one seat connected to the rack. The seat includes an assembling portion and an attached portion spaced from the assembling portion. The assembling portion is detachably mounted to the rack. The attached portion includes an abutted face and a recess. The abutted face is located opposite to the rack. The recess is located between the abutted face and the assembling portion. The recess receives a magnet adapted to magnetically attach to a metal object.