Borrowed from Scots tot, a shortened form of totum (“small child; tot”), of uncertain origin, perhaps shortened from totter (“to move in an unsteady way”),
Compare tottle, also Old Norse tottr (“name of a dwarf”), Swedish tutte (“small child”), Danish tommeltot (“little child”).