This study investigates determinants of bilateral foreign direct investment (FDI) on both margins, the extensive margin (whether to invest) and the intensive margin (how much to invest), based on the recent structural gravity model for FDI developed by Anderson et al. (Trade and investment in the global economy. National Bureau of Economic Research, Cambridge, MA, 2017). I examine a global data set comprised of 110 countries over 9 years, 2004–12. Apart from conventional gravity variables, the source country's technology capital shows a significant and positive impact on both FDI margins. Bilateral investment treaties play a significant role only in determining the extensive margin. Results on FDI stocks and FDI flows can lead to different conclusions; thus, research should consult both types of data series to find which variables have robust effects. Furthermore, breaking down the sample by country development levels reveals that FDI from less‐developed countries (LDCs) is not affected by many common variables, and thus, there is a need to develop more theories and empirical work to investigate the FDI from LDCs in particular.