Method for assigning tools w i to spaces p i in a tool magazine, wherein the tool magazine is configured to hold ready a number of tools w i for a machine tool, wherein the tool magazine comprises a feeder for conveying tools w i; wherein the method comprises the following steps: - acquiring a sequence of planned working steps s i of the machine tool; - wherein each working step s i is assigned a tool w i, by means of which the machine tool carries out the working step s i, and a processing time t i, during which the tool w i is used by the machine tool, o wherein, before the working step s i, the feeder conveys the tool w i from its assigned space p i in the tool magazine to a transfer point, o where said tool is picked up by the machine tool, o wherein, after the working step s i, the tool w i is set down by the machine tool at the transfer point, o from where said tool is conveyed to its assigned space p i in the tool magazine by the feeder; - wherein each space p i is assigned a time b i that the feeder requires to convey a tool w i from the space p i to the transfer point or vice versa; characterized by the following steps: - determining a maximum cycle time that the feeder requires to convey a tool w i-1 of a working step s i-1 that has been performed from the transfer point to its assigned space p i-1, to move from there to the space p i+1 of the tool w i+1 of an impending working step s i+1, and to convey the tool w i+1 from there to the transfer point; - determining a set M with all triplets r i of successive working steps s i-1, s i, s i+1 in the case of which the processing time t i of the working step s i is shorter than the maximum cycle time; - (a) determining relevances of the triplet r i of the set M, wherein the relevance of a triplet r i comprises a number of movements or conveying actions that are defined as the tool w i-1 is assigned to a space p i-1 and the tool w i+1 is assigned to a space p i+1; - (b) determining a triplet of the set M with the highest relevance; - (c) assigning the tool w 1 of the determined triplet to a space p i and/or the tool w 3 to a space p 3 such that the processing time t 2 is shorter than, or is longer to the least possible extent than, the sum of the times required for conveying the tool w 1 from the transfer point to the space p 1, for moving the feeder from there to the space p 3 and for conveying the tool w 3 from there to the transfer point; - (d) removing the determined triplet from the set M; - repeating steps (a) to (d) until the set M is empty; and - assigning unassigned tools w i to unassigned spaces p i of the tool magazine. - acquiring a sequence of planned working steps s i of the machine tool; - wherein each working step s i is assigned a tool w i, by means of which the machine tool carries out the working step s i, and a processing time t i, during which the tool w i is used by the machine tool, o wherein, before the working step s i, the feeder conveys the tool w i from its assigned space p i in the tool magazine to a transfer point, o where said tool is picked up by the machine tool, o wherein, after the working step s i, the tool w i is set down by the machine tool at the transfer point, o from where said tool is conveyed to its assigned space p i in the tool magazine by the feeder; o wherein, before the working step s i, the feeder conveys the tool w i from its assigned space p i in the tool magazine to a transfer point, o where said tool is picked up by the machine tool, o wherein, after the working step s i, the tool w i is set down by the machine tool at the transfer point, o from where said tool is conveyed to its assigned space p i in the tool magazine by the feeder; - wherein each space p i is assigned a time b i that the feeder requires to convey a tool w i from the space p i to the transfer point or vice versa; - determining a maximum cycle time that the feeder requires to convey a tool w i-1 of a working step s i-1 that has been performed from the transfer point to its assigned space p i-1, to move from there to the space p i+1 of the tool w i+1 of an impending working step s i+1, and to convey the tool w i+1 from there to the transfer point; - determining a set M with all triplets r i of successive working steps s i-1, s i, s i+1 in the case of which the processing time t i of the working step s i is shorter than the maximum cycle time; - (a) determining relevances of the triplet r i of the set M, wherein the relevance of a triplet r i comprises a number of movements or conveying actions that are defined as the tool w i-1 is assigned to a space p i-1 and the tool w i+1 is assigned to a space p i+1; - (b) determining a triplet of the set M with the highest relevance; - (c) assigning the tool w 1 of the determined triplet to a space p i and/or the tool w 3 to a space p 3 such that the processing time t 2 is shorter than, or is longer to the least possible extent than, the sum of the times required for conveying the tool w 1 from the transfer point to the space p 1, for moving the feeder from there to the space p 3 and for conveying the tool w 3 from there to the transfer point; - (d) removing the determined triplet from the set M; - repeating steps (a) to (d) until the set M is empty; and - assigning unassigned tools w i to unassigned spaces p i of the tool magazine.