Some of the imperial art collections, the most important parts of which were obtained through the activities of Archduke Ferdinand II of Tyrol (1529–1595), Emperor Rudolf II (1552–1612) and Archduke Leopold Wilhelm (1614–1662), were available for limited public view from the early modern era onwards. Valuable musical instruments, suits of armour and Ferdinand II's cabinet of art and curiosities were stored at Schloss Ambras in Innsbruck; antique treasures such as the Gemma Augustea, Renaissance handicraft masterpieces, and paintings by Bruegel and Dürer were to be found in Prague Castle. Under Emperor Charles VI (1685–1740) the Imperial Picture Gallery was established in the Stallburg in the centre of Vienna, being subsequently transferred in that century to the Upper Belvedere. The coin and antique collection was in the Augustinergang in the Hofburg. From 1823, antique sculptures were shown in the newly built Theseustempel in the Volksgarten, and after 1837 other antique art objects were housed in the Lower Belvedere. The collection of Egyptian antiques compiled in the wake of Napoleon's expedition in 1798/99 could be viewed from 1823 to 1837 in Harrach'sches Haus, now Johannesgasse 7, which also contained the Brazilian Museum featuring objects from James Cook's global expeditions. The historical weaponry from the old Zeughaus in Renngasse was transferred in 1863 together with more modern military equipment to the newly built Arsenal. The k. k. Kunsthistorisches Hofmuseum, built in 1871 and ceremoniously opened in 1891, was designed to house all of these imperial art collections under one roof. According to the 1876 general inventory, the imperial art and historico-cultural collections privately owned by the emperor consisted of 172,514 objects. There were seven special collections administered by three departments (coins, medals and antiques, weapons and industrial art objects, and the picture gallery). From 1889 there was also a joint administrative chancellery for the Naturhistorisches and Kunsthistorisches Museum. With the shortage of space resulting from the increase in size of the collections, new premises for display and storage were sought even during the monarchy. In 1905 three additional display rooms were leased in the Lower Belvedere. In 1908 the modern section of the picture gallery was transferred to the Neue Burg, where the Estensian collection was already housed and where, from 1916, the musical instruments from Schloss Catajo and the Ambras collection were put on display together. Apart from short periods of closure, the museum remained open for two or three days a week during the First World War.
A week after the proclamation of the Republic of German-Austria on 12 November 1918, the court museums were placed under the protection of the state. In December 1918, the State Chancellery banned the export and sale of art and historico-cultural objects. Under the law of 3 April 1919, the Republic took possession of the former assets of the house of Habsburg-Lorraine. On 29 September 1920 the name of the museum was changed to Kunsthistorisches Staatsmuseum in Wien, and from 1 September 1921 to Kunsthistorisches Museum. The provisional regulations for art collections of 1919 called for the establishment of an advisory board consisting of full-time researchers from the museum, which, with the assistance of the administrative chancellery, was to handle all interdisciplinary aspects of the museum (status, personnel and material questions, publication of the yearbook, supervision of the museum library, and the photography workshop). The advisory board handled all business until 1925. The new regulations called for its replacement by a First Director, proposed from among the collection managers by the general meeting of the advisory board. Towards the end of the First Republic, the museum acquired two important private collections: in 1931 parts of the art collection of the deceased banker Albert Figdor as a gift, and in 1932 the collection belonging to the industrialist Gustav Benda as a legacy.
At the end of 1933, in keeping with the authoritarian spirit of the times, the First Director was given additional powers. Apart from representing the museum externally, all exhibition, personnel and space allocation decisions were now his responsibility. Alfred Stix, hitherto director of the Albertina, became First Director in 1934. The responsibilities of the collection managers were now confined to research and conservation. The Kunsthistorisches Museum attempted to raise funds for the purchase of valuable art objects available in large numbers on the art market in the wake of the economic crisis through the sale and exchange of duplicates approved by the museum's expert committees from 1923. Exchanges were also to be made among the state museums so as to focus the respective collections. Planned during the First Republic, these exchanges took place during the period of Austrofascism and the Nazi regime. The Collection of Greek and Roman Antiquities obtained objects from the prehistoric collection of the Naturhistorisches Museum in 1935 and from the Staatliches Kunstgewerbemuseum in Wien (State Arts and Crafts Museum in Vienna) in 1940; the Imperial Armoury, which had been loaned during the First World War to the Heeresmuseum, was ceded to it in 1935; and the National Library's manuscripts collection obtained works from the Ambras collection in 1936. In 1934, the Imperial Armoury was transferred from the main building to the Neue Burg and a new exhibition opened there in 1936, and the free space was used for the Collection of Sculptures, Arts and Crafts. The Picture Gallery opened a section for Austrian Gothic panel painting. To acquire the twelfth-century communion chalice from Wilten Abbey near Innsbruck, a few objects, including valuable tapestries, were sold towards the end of the Dollfuß-Schuschnigg regime.
On 15 March 1938, directly after the annexation of Austria, the art historian Fritz Dworschak, hitherto curator in the coin collection, was made provisional First Director. Alfred Stix and four other leading officials were dismissed. Other dismissals on political and "racial" grounds were to follow. Long-standing NSDAP members, such as weapons expert Leopold Ruprecht, the numismatist Fritz Manns and the librarian Karl Ortner occupied the vacated positions. Regular staff roll-calls now took place, and at one of these on 26 March 1938 it was announced that the propaganda exhibition on the "plebiscite" organized by Rudolf Noll, a staunch Nazi and curator of the antiques collection, would open on 10 April. From August 1938 a museum security service, consisting of NSDAP members only and exclusively answerable to the provisional director, took over the police in guarding the premises of the Albertina, Imperial Treasury, Neue Burg and Kunsthistorisches and Naturhistorisches Museum. In 1938 as well, Dworschak considered it his "sacred duty" to commission the sculptors and medallists Edwin Grienauer and Wilhelm Frass to make two oversized busts of Hitler for the lobby of the Kunsthistorisches Museum and the Neue Burg. The work focus changed for some museum staff, as reported in the 1939 coin collection annual report: "Above all, the cataloguing of the movements of private art objects and the constant collaboration with the Gestapo took up a good deal of the time that had previously been devoted to the museum's collections." The complaint about the time taken with external work conceals the fact that the art market had revived, particularly through the measures taken by the Nazi regime (seizures and securing of objects immediately after the annexation, mandatory reporting of assets). Through the establishment of a Zentraldepot für beschlagnahmte Sammlungen (central depot for seized collections) in the Neue Burg in autumn 1938, the Kunsthistorisches Museum hoped to have privileged access to the art objects expropriated systematically since March 1938 from owners deemed to be Jewish so as to add to its own inventories. The wish lists prepared by all interested institutes were not taken into account to any great extent, first because the Reich Chancellery decree of 18 June 1938 gave Hitler sole authority to dispose of the expropriated objects, some of which were reserved for the planned museum in Linz, and second because the museums in Vienna, Linz, Graz, Klagenfurt and Innsbruck were also interested in acquiring the best objects. Adolf Hitler visited the Central Depot next to the rooms where the weapons collection was on show on 25 October 1938, just a few weeks after it was installed, and paid a second visit on 11 June 1939. During the Nazi era the museum's functions were enlarged. The public relations office established at the end of 1938 and headed by the historian Alphons Lhotsky, maintained contact with film, radio, press and party offices, organized guided tours and talks, monitored reproduction rights and, from 1942, was also in charge of the photography workshop. A building department headed by the architect Helene Buchwieser was also established in the Kunsthistorisches Museum to implement the various building projects, although it was closed again in November 1940 because of the war. In 1939 the collection of musical instruments was separated from the sculpture and applied art collection and housed in Palais Pallavicini.
Fritz Dworschak headed the salvage operations for the Vienna museums from 1939 to 1942. The storage of the most valuable objects from the Kunsthistorisches Museum and the Central Depot started the day before war began. A war exhibition opened on 15 October 1939 with unstored objects. After further storage and regrouping, the new war gallery was presented in November 1941. In March 1940 the Kunsthistorisches Museum showed new acquisitions since the reunification of Austria with the German Reich in the Neue Burg. Further Nazi propaganda exhibitions followed, such as a display of items returned from the Musée de l'Armée in Paris in the Neue Burg from April 1941, or the special exhibition there to mark the Day of German Home Music. In summer 1942 the main building held an exhibition entitled Die deutsche Gußmedaille. With the abolition of the Teutonic Order and the Order of the Golden Fleece and the confiscation of various monastery collections, above all the incorporation of Stift Klosterneuburg, the Kunsthistorisches Museum saw not only significant additions to its art and historico-cultural collections but also a steady increase in staff. In early 1938 the museum had a staff of 123, which grew to 200 in early 1939, 299 by the end of 1941, and finally 343 in early 1945.
After the war, 118 staff members (111 men, including 36 from the museum security, and 7 women) of the Kunsthistorisches Museum were subject to registration under the Constitutional Law on Prohibition of the NSDAP of 8 May 1945. Not all of them were dismissed, and sixteen were still employed by the museum in April 1947. Dworschak retrospectively put the budgetary cost of "acquisitions and (building) installations" from 1938 to 1945 at 2,002,297 Reichsmarks from regular funds and 1,820,800 Reichsmarks from extraordinary funds (special loan from the Reichsstatthalterei). According to the list of changes in the inventories during the Nazi era established by Herbert Haupt and Lydia Gröbl in 1998, there were 19,651 new objects, including 15,137 in the coin collection. Of these, one-third—7,188, including 7,080 coins and medals—were returned to their original owners or legal successors after the war. The report drawn up under the Art Restitution Act of 4 December 1998, which can be consulted in the museum's archive, listed a further 772 suspicious or possibly suspicious acquisitions, for which dossiers were subsequently prepared, either for individual objects or for groups of objects acquired at the same time, and submitted to the Art Restitution Advisory Board. The Board has examined thirty-nine dossiers since 1998 and recommended the return of more than 1.000 objects, including 669 coins and medals. Dossiers on the following collections have been submitted to the Board (in alphabetical order): Guido Adler, Isolde Ahlgrimm and Erich Fiala, Elizabeth Bondy, Oscar Bondy, Jaromir Czernin, Deutscher Orden, Stefan Paul und Vera Dukes, Hermann Eissler, Otto Feist, Siegfried Fuchs, Leo Fürst, Frida Gerngross, Jacques Goudstikker, Rudolf Gutmann, Marianne Hamburger-Löw, Leo Heymann, Bruno Jellinek, Ernst Kris, Moritz Kuffner, Anton Lanckoroński, Erich Lederer, Felix und Josefine Löw-Beer, Robert Mayer, Alfred Menziles, Richard Neumann, Albert Pollak, Rudol Raue, Carl Reininghaus, Eduard Reiseneder, Moritz Rothberger (2), Alphonse, Clarice & Louis Rothschild (3), Valentine Springer, Silbermann/Weinstein, Mary Wooster, and the Zsolnay collection.
Based on the fundamental research by the historian and former KHM archive director Herbert Haupt on the history of the Kunsthistorisches Museum during the Nazi era, provenance research has been continued systematically since 2009 and was expanded in accordance with the amended version of the Art Restitution Act of the same year.