Forests have a wide range of social-ecological functions, such as storing carbon, preventing natural hazards, and providing food and shelters. Monitoring the status of forests not only deepens our understanding of climate change and ecosystems, but also helps guiding the formulation of ecological protection policies. Remote sensing based analyses of forests are typically limited to forest cover, and most of our knowledge of forests mainly comes from forest inventories, where tree density, canopy cover, species, height, carbon stock and other indicators are recorded. The inventories are conventionally established by manually collecting in-situ measurements, which can be time-consuming, labor-intensive and difficult to scale up. Here we present an automatic and scalable tree inventory pipeline based on publicly available aerial images from Denmark and deep neural networks, enabling individual-tree-level canopy segmentation, counting, and height estimation within different kinds of forests. The canopy segmentation and counting tasks are solved in a multitasking manner, where a convolutional neural network is trained to jointly predict a segmentation mask and a density map which sums up to the total tree count for a given image. Another network trained with LiDAR-derived height maps estimates per-pixel canopy height from aerial photos, which, when combined subsequently with the canopy segmentation masks, allows for per-tree height mapping. The multitasking network achieves a segmentation dice coefficient of 0.755 on the testing set with 3904 manually annotated trees and a predicted total count of 3869 (r2 = 0.84). Compared with independent LiDAR reference heights, the height estimation model achieves a per-pixel mean absolute error (MAE) of 2.6 m on the testing set and a per-tree MAE of 3.0 m when assigning tree height with the maximum height estimate within each predicted canopy. The models perform robustly over diverse landscapes including dense forests (coniferous and broad-leaved), open fields, and urban areas. We further verify the scalability of the framework by detecting 312 million individual trees across Denmark.