A medical instrument includes first elements provided in an insertion portion, second elements provided outside a subject, a signal control unit, a position detection unit, a position estimating unit, and an insertion shape generation unit. The signal control unit causes a magnetic field to be transmitted and received between predetermined elements among the first elements and the second elements. The position detection unit detects the positions of the predetermined elements among the first elements from the result of the transmitting and receiving of the magnetic field. The position estimating unit estimates the positions of the first elements other than the predetermined elements among the first elements. The insertion shape generation unit generates a shape of the insertion portion on the basis of each of the positions of the first elements other than the predetermined elements in addition to each of the positions of the predetermined elements.