In the last few years there has been a growing interest around layered or so-called twodimensional (2D) metal halide perovskites (MHPs) for their superior moisture and air stability, thanks to which they found application in photovoltaics to design 2D/3D solar cells architectures. The most investigated families of 2D perovskites are the Ruddlesden-Popper (RP) and Dion-Jacobson (DJ) phases of general formula A′2An-1MnX3n+1 and A′An-1MnX3n+1, respectively, where A′ and A are organic cations, and n represents the number of staggered inorganic layers made of metal M and halide X atoms. Lead-based members with n=1 of the RP family, i.e. A2PbX4, have been thoroughly studied thanks to the extremely rich variety of organic spacers which can be incorporated into the layered structure giving origin to an impressive modulation of their optical, structural and moisture-resistance properties. 2D RP perovskites containing linear monoammonium cations of general formula (CnH2n+1NH3)2PbX4, have been among the first to be explored, even before the advent of MHPs photovoltaics. These early studies mostly focused on the elucidation of the crystal structure as a function of the number of carbon atoms in the aliphatic chain as well as on the understanding of the phase transitions commonly found in these compounds. While the early investigation of the optical properties is quite limited, this important group of publications provides a very accurate and solid structural basis for current research. In particular, Billing reported the crystal structure and phase transition behavior of the (CnH2n+1NH3)2PbI4 perovskite series for 4≤n≤16 showing, in general, the presence of multiple reversible phase transitions due to changes in the hydrocarbon chains and the relative arrangement of the inorganic layers. Some of these compositions, in the form of single crystals, have been also characterized in terms of their optical properties indicating that the photoluminescence (PL) spectra for 4≤n≤12 are very similar but without providing detailed quantitative data and putting emphasis on the temperature dependence of the optical transitions. More recently, thin films of compounds of the (CnH2n+1NH3)2PbI4 family for n=4, 5, 7, 8 and 9 have been characterized by low-temperature PL reporting a variation of the excitonic structure along with the number of carbon atoms and showing the formation of a fine structure made of three levels for temperatures below 100 K. Recently, the optical properties as a function of the number of carbon atoms in (CnH2n+1NH3)2PbI4 perovskites for 4≤n≤18, in the form of thin films, have been reported, and the trend of the optical band-gap systematically correlated to structural effects induced by the variation of the chain length on the PbI6 octahedra. A limited amount of work has been carried out on the analogous system containing Br instead of I, namely the (CnH2n+1NH3)2PbBr4 perovskites. To the best of our knowledge, only the crystal structure of (C4H9NH3)2PbBr4, together with room-temperature optical properties characterization, has been recently reported. A partial systematic exploration of the effect of hydrocarbon chain length in the (CnH2n+1NH3)2BrI4 systems has been carried out for n=4, 5, 7, and 12, providing a general evidence of the role of n on the excitonic structure. One of the most appealing aspects of 2D MHPs is their improved air and moisture resistance compared to 3D perovskites. This specific aspect has been considered only in one recent publication, where the hydrophobicity of the (C16H33NH3)2PbI4 phase has been not only demonstrated by collecting x-ray diffraction (XRD) data before and after water treatment, but also effectively employed in photoredox catalysis. The relevance of 2D MHPs in the current research, particularly for their improved moisture resistance, calls for systematic and complete studies of their structural and optical properties, including their phase transition behavior, especially for the Br-containing systems, and stability investigation as a function of hydrocarbon chain length. In the present paper we address these issues by studying the (CnH2n+1NH3)2PbX4 systems for X=Br, and I and n=4, 6, 8, 10, 12, 14 and 16. In addition to the aspects reported previously, this work provides the first detailed investigation on the (CnH2n+1NH3)2PbBr4 series and a comparative study of the impact of the number of carbon atoms on two analogous systems characterized by a different halide (Br and I). The results presented below allowed to define a complete picture of the impact of the hydrocarbon chain length on the properties of 2D MHPs containing linear monoammonium cations which can be of relevance to other analogous organic spacers and help in the further design of layered perovskites with tailored properties.