We present a very efficient and accurate method to simulate scanning tunneling microscopy images and spectra from first-principles density functional calculations. The wave-functions of the tip and sample are calculated separately on the same footing, and propagated far from the surface using the vacuum Green's function. This allows to express the Bardeen matrix elements in terms of convolutions, and to obtain the tunneling current at all tip positions and bias voltages in a single calculation. The efficiency of the method opens the door to real time determination of both tip and surface composition and structure, by comparing experiments to simulated images for a variety of precomputed tips. Comparison with the experimental topography and spectra of the Si(111)-(7×7) surface show a much better agreement with Si than with W tips, implying that the metallic tip is terminated by silicon.PACS numbers: 68.37. Ef, 07.79.Cz, 68.35.Bs The development of scanning tunneling microscopy [1] (STM) and spectroscopy (STS) has provided an unprecedented knowledge about a rich variety of surface science aspects [2,3]. STM and STS convey information about the local geometric and electronic structure of metallic and semiconducting surfaces, which has extensively served to unravel their atomic arrangements and reconstructions, but also to analyze surface defects, study adsorbate-covered solid samples or monitor dynamic surface processes like oxidation or diffusion, to give only some examples. The feasibility of atom by atom chemical analysis was dreamed of since an early stage, due to the unique combination of spatial and energetic resolutions. Currently, STM achieves atomic resolution routinely, while discrimination between atomic species has been reported in particular cases. However, a detailed structural analysis, directly from the experiments, is generally far from a minor task, because structural and electronic properties intermixed in the STM images. An even more fundamental difficulty is the lack of control and knowledge on the composition and structure of the tip. This is particularly crucial in the case of STS, where tip states can entirely modify the spectra. As a result of these uncertainties, a careful comparison with theoretical simulations is generally needed to interpret safely the experimental information. To such an end, much progress has been done towards the theory of STM [4] since the pioneering use of perturbation theory by Bardeen [5]. Tersoff and Hamann (TH) [6], made the additional assumption that the tunnel current is dominated by a single s-state of the tip, what leads to a simple expression involving only the local density of states (DOS) of the surface. When experiments are highly reproducible, regardless of the tip used, this can be sufficient. However, approaches beyond TH [2,7,8], which include the electronic structure of the tip, have been necessary to explain many observations, like bias-dependent images or negative differential resistances. On the other hand, non-perturbative approaches, which ...