Evaluating pXRF accuracy for predicting soil fertility: effects of moisture and soil properties Authors: Joao Antonangelo, Somsubhra Chakraborty, Deepanjan Mridha, Shikha Singh, Surendra Singh Published: 2026 ABSTRACT AbstractPortable X-ray fluorescence (pXRF) has emerged as a rapid, cost-effective tool for assessing soil fertility in precision agriculture. While the influence of soil moisture on pXRF elemental detection has been widely studied, its specific impact on nutrient prediction accuracy, particularly when combined with key soil properties, remains less well quantified. This study investigates how moisture conditions affect pXRF-based detection of soil nutrients and evaluates whether integrating soil properties enhances prediction accuracy. Using stepwise multiple linear regression (SMLR), available macronutrients and micronutrients were modeled from pXRF data under dry soil (DS), field moisture (FM), saturated paste (SP), and after the removal of excess water (AREW) from SP. At both DS and SP, pXRF yielded strong predictions for macronutrients, with R2 values ranging from 0.54 to 0.74 for K, 0.49–0.59 for Ca, and 0.60–0.69 for Mg (all p < .0001), while predictions for Cu and Zn were low to moderate. Incorporating soil pH and organic matter (OM) improved model performance, increasing R2 values by 1.1- to 6.1-fold compared to models based solely on pXRF data. These findings highlight the need for standardized sample preparation, especially regarding moisture, and demonstrate that combining pXRF with key soil attributes enhances its utility as a reliable tool for rapid nutrient assessment in diverse soil conditions.Supplementary InformationThe online version contains supplementary material available at 10.1038/s41598-026-58282-8.Keywords: Portable X-ray fluorescence (pXRF), Soil nutrient prediction, Soil moisture effects, Precision agriculture, Soil propertiesSubject terms: Ecology, Ecology, Environmental sciences Introduction Accurate evaluation of soil pH, organic matter (OM), and nutrient concentrations is essential for assessing soil health and fertility1–3. Traditional wet-chemistry methods provide reliable measurements, however, require costly instrumentation, hazardous reagents, and lengthy analysis4,5, which delays management decisions and limits large-scale soil testing. Recently, proximal sensors like Portable X-ray fluorescence (pXRF) spectroscopy provides a rapid, non-destructive alternative for quantifying soil elements. By detecting fluorescent X-rays emitted when a sample is irradiated, pXRF simultaneously measures multiple elements (magnesium to uranium) with minimal preparation. The pXRF spectrometry has been used for assessing elemental, nutrient, and heavy metal concentrations as well as to characterize soil parameters including pH, cation exchange capacity (CEC), base saturation, and texture6–12. Its portability and fast calibration make it suitable for both laboratory and field applications12,13. Similarly to the available spectroscopy techniques, such as Atomic Absorption Spectroscopy (AAS), and Atomic Emission Spectroscopy (AES), XRF also quantifies total elemental concentration.However, pXRF’s handheld design make it ideal for rapid solid-state field analysis. Although several studies have used pXRF to estimate nutrient concentrations3,10,13, most were performed on dry soils and produced site specific calibration equations that are not easily implemented on different soil types. This limits the broader applicability of those findings and underscores the need for alternate standardized approaches. Some studies have highlighted that pXRF could be used for moist soil analysis14–16. However, available studies have produced inaccurate results due to soil moisture, as they failed to account for soil moisture correction14,17–19. Moisture strongly influences XRF analysis as water alters both the physical and compositional properties of the soil matrix. Water and organic matter (OM), composed primarily of low atomic number elements such as C, H, and O, modify the bulk matrix composition and X-ray attenuation behavior. Although these components generally exhibit lower mass attenuation coefficients (MACs) than many mineral constituents, water itself still attenuates X-ray through both photoelectric absorption and scattering processes, particularly at lower photon energies20,21. The effect of soil moisture on XRF measurements is complex and results from interacting mechanisms. First, added water dilutes the concentration of mineral particles within the irradiated volume, reducing the relative abundance of heavier mineral phases and thereby affecting fluorescence intensity22,23. Second, moisture alters bulk density, particle packing, and pore structure, which can influence X-ray penetration depth and the escape probability of fluorescent photons24. Third, water introduces additional absorption and scattering pathways that may suppress fluorescence signals, especially for low-energy fluorescence lines such as Mg, Al, Si, and P20,25. Consequently, the influence of moisture on XRF measurements reflects the combined effects of matrix dilution, photon attenuation, scattering, and changes in soil physical structure rather than a simple increase or decrease in attenuation. Although laboratory moisture correction is possible, it is labor intensive and reduces the efficiency of in-situ analysis26. Therefore, evaluating pXRF performance across different field moisture levels is essential to optimize its use for predicting plant available nutrients. Soil pH, OM content, and moisture conditions at various depths significantly influence nutrient retention, release, and availability. While pXRF data provides total elemental concentrations, it is essential to integrate these factors such as soil depth, moisture, OM, and pH to fully capture trends and develop a more comprehensive and applicable model. Analyzing nutrient concentrations alongside these variables at varying soil depths and moisture levels is crucial for accurately predicting the availability of nutrients using pXRF. This study investigates the influence of soil moisture on elemental detection using pXRF and evaluates regression models for predicting soil pH and nutrient availability. The objectives are to (i) assess the impact of soil moisture on elemental detection by pXRF from samples collected in eastern Washington (WA), U.S., (ii) evaluate the predictive performance of simple and multiple regression models for soil available nutrients, and (iii) determine the effect of incorporating soil pH and OM into the models. We hypothesize that (i) while the effect of soil moisture on pXRF elemental detection is known, it influences the predictive accuracy of nutrient models particularly between mobile and immobile elements; and (ii) incorporating soil properties such as pH and OM improves the performance of predictive models beyond pXRF data alone, regardless of soil moisture conditions. Materials and methods Sample collection and preparation Soil samples were collected from several agricultural fields of the inland Pacific Northwest (iPNW), Washington, USA (Fig. 1). A total of 113 samples were collected from 31 locations and three soil layers: 0–30 cm, 30–60 cm, 90–120 cm. Approximately 8–10 cores from a 1-acre field area (~ 0.405 ha) were sampled in ‘zig-zag’ pattern to make a composite sample. Study area and soil samples collection sites (prepared with ArcGIS Pro 3.5). The soil series, taxonomic classification, and county (Soil Survey Staff: https://websoilsurvey.nrcs.usda.gov/app/) from which the soils were collected are given in Table 1. The climatic conditions of the iPNW are semiarid, with warm, dry summers and cold, moist winters. The annual average precipitation and temperature in this region are 152–508 mm and 4–9 °C, respectively. The region is primarily characterized by Mollisols and Ardisols (Table 1), while Entisols, Alfisols, Inceptisols, and Andisols are also present (https://soilseries.sc.egov.usda.gov/). To check the effect of moisture levels on pXRF elemental analysis, the collected soil samples were analyzed at four soil moisture conditions: field moisture (FM; represents the actual moisture content of the collected soil), dried soil (DS; dried in hot air oven at 65 °C), Saturated paste (SP; saturated with distilled water), and after removal of excess water (AREW; soil moisture after free drainage from the SP). Table 1Sampling location (coordinates and county), soil series, and taxonomic classification of soils sampled across Washington (WA) state.Sample IDLatitudeLongitudeCountySeriesClassification1A46.92371− 118.397AdamsRitzville silt loamCoarse-silty, mixed, superactive, mesic Calcidic Haploxerolls1B46.95713− 118.377AdamsRitzville silt loamCoarse-silty, mixed, superactive, mesic Calcidic Haploxerolls2A46.9638− 118.345AdamsRitzville silt loamCoarse-silty, mixed, superactive, mesic Calcidic Haploxerolls2B46.85501− 118.377AdamsRitzville silt loamCoarse-silty, mixed, superactive, mesic Calcidic Haploxerolls3A46.78142− 118.352AdamsRitzville silt loamCoarse-silty, mixed, superactive, mesic Calcidic Haploxerolls4A47.65067− 118.132LincolnBroadax silt loamFine-silty, mixed, superactive, mesic Calcic Argixerolls4B47.65346− 118.133LincolnBroadax silt loamFine-silty, mixed, superactive, mesic Calcic Argixerolls5A47.3515− 118.377LincolnRenslow silt loamCoarse-silty, mixed, superactive, mesic Calciargidic Argixerolls6A47.14257− 118.474AdamsRitzville silt loamCoarse-silty, mixed, superactive, mesic Calcidic Haploxerolls7A47.64182− 117.772SpokaneBrincken ashy silt loamLoamy-skeletal, mixed, superactive, mesic Vitrandic Argixerolls7B47.76286− 117.861LincolnHanning silt loamFine-silty, mixed, superactive, mesic Pachic Argixerolls7C47.70719− 117.908LincolnHanning silt loamFine-silty, mixed, superactive, mesic Pachic Argixerolls7D47.71917− 117.942LincolnBroadax silt loamFine-silty, mixed, superactive, mesic Calcic Argixerolls8A47.80221− 118.655LincolnBagdad silt loamCoarse-silty, mixed, superactive, mesic Calcic Argixerolls8B47.83013− 118.586LincolnBagdad silt loamCoarse-silty, mixed, superactive, mesic Calcic Argixerolls9A47.64855− 118.643LincolnRenslow silt loamCoarse-silty, mixed, superactive, mesic Calciargidic Argixerolls10A47.80276− 118.63LincolnBagdad silt loamCoarse-silty, mixed, superactive, mesic Calcic Argixerolls11A47.81601− 118.876LincolnBagdad silt loamCoarse-silty, mixed, superactive, mesic Calcic Argixerolls12A47.81921− 118.915LincolnBagdad silt loamCoarse-silty, mixed, superactive, mesic Calcic Argixerolls12B47.7542− 118.916LincolnWillis silt loamCoarse-silty, mixed, superactive, mesic Haploduridic Durixerolls13A47.78998− 119.077GrantBagdad silt loamCoarse-silty, mixed, superactive, mesic Calcic Argixerolls14A47.61747− 118.83LincolnRoloff silt loamCoarse-loamy, mixed, superactive, mesic Aridic Haploxerolls15A47.57099− 119.062GrantRenslow silt loamCoarse-silty, mixed, superactive, mesic Calciargidic Argixerolls16A47.81862− 119.526DouglasTouhey-Stubblefield complexLoamy-skeletal, mixed, superactive, mesic Cambidic Durixerolls17A47.79878− 119.731DouglasTouhey-Stubblefield complexLoamy-skeletal, mixed, superactive, mesic Cambidic Durixerolls18A47.20336− 118.868AdamsShano silt loamCoarse-silty, mixed, superactive, mesic Xeric Haplocambids18B47.18523− 118.852AdamsShano silt loamCoarse-silty, mixed, superactive, mesic Xeric Haplocambids19A47.28694− 118.91LincolnShano silt loamCoarse-silty, mixed, superactive, mesic Xeric Haplocambids20A47.52002− 118.631LincolnRenslow silt loamCoarse-silty, mixed, superactive, mesic Calciargidic Argixerolls20B47.5258− 118.637LincolnRoloff silt loamCoarse-loamy, mixed, superactive, mesic Aridic Haploxerolls21A46.82097− 117.802WhitmanWalla Walla silt loamCoarse-silty, mixed, superactive, mesic Typic HaploxerollsFrom each sampling location composite soil samples were collected from different depths (n = 113). The classification of soils based on USDA soil survey data (https://websoilsurvey.nrcs.usda.gov/app/). Sampling location (coordinates and county), soil series, and taxonomic classification of soils sampled across Washington (WA) state. From each sampling location composite soil samples were collected from different depths (n = 113). The classification of soils based on USDA soil survey data (https://websoilsurvey.nrcs.usda.gov/app/). Saturated paste samples were prepared by gradually adding distilled water to the processed soil until a glossy surface appeared27. After a 1 h rest, the samples were mixed and covered, then allowed to rest for at least 4 h to ensure equilibrium. The paste was analyzed directly using pXRF and again AREW by allowing the leachate to drain naturally. Moisture content was determined for each sample at each soil moisture condition. Wet chemical and pXRF analysis The collected soil samples were air-dried and passed through a 2-mm sieve before the wet chemical analysis was conducted in the laboratory. The soil samples were analyzed for pH (1:1), OM using Walkley–Black method28, available P using Olsen method29, exchangeable cations (Ca2+, Mg2+, and K+) using NH4OAc method30, and micronutrients (Zn, Fe, Mn, and Cu) using DTPA (diethylenetriaminepentaacetic acid) method31. The ‘as-is’ FM, DS, SP and AREW soil samples were analyzed using pXRF (Bruker, S1 Titan 800; USA). For FM, SP, and AREW, we did not apply corrections to account for moisture-induced dilution effects. This approach was intentional, as the aim was not to calibrate pXRF values against oven-dried samples but to evaluate its unadjusted predictive performance under realistic field-relevant moisture scenarios. The rationale was to reflect practical conditions under which pXRF might be deployed for rapid, in-situ soil analysis, where moisture correction may not be feasible. Although additional tools such as portable moisture sensors or vacuum-based extraction devices could be employed to normalize for water content, their use may undermine the efficiency and accessibility of field-based measurements. This design choice aligns with previous research16,32,33, which reported that, while moisture can reduce pXRF accuracy, particularly at water contents exceeding ~ 40%, reliable predictions are still achievable at lower moisture levels without the need for correction. The pXRF analysis of soil samples was carried out as described by Antonangelo and Zhang1,34. Before analyzing, the application mode of the pXRF was set to ‘Soil nutrient and Heavy Metal’ to auto calibrate the instrument. The Bruker S1 Titan 800 utilizes empirical calibration methods rather than Fundamental Parameters (FP) for quantitative elemental analysis. Soil samples were packed in a pXRF sample cup and placed on top of the examination window of the pXRF. The measurement was carried out at following settings of 50 kV voltage, and 39 µA current of X-ray tube, allowing for the identification of Mg–U elements in the periodic table. Each sample analysis took 60 s, with two scan phases averaging 30 s each. For quality control of the elemental analysis, manufacturer provided soil standard (CS-M2, Bruker) was checked after assessment of every 20 soil samples. The average standard analysis for quality control and the limit of detection for each element is given in Supplementary Table S1. Statistical analysis Boxplot distributions were generated to visualize the variability in soil pH and OM by soil depth, moisture levels for each soil moisture condition, and soil available nutrients across the entire dataset. Descriptive statistics, including mean, median, and minimum-to-maximum range, were computed for elemental concentrations determined by pXRF under the four moisture conditions and for the wet chemistry-derived nutrients (P, K, Ca, Mg, Cu, and Zn). Regression models (linear, quadratic, and power) were constructed to examine the relationship between soil available nutrients (P, K, Ca, Mg, Cu, Fe, Mn, and Zn) from wet chemistry analyses and their corresponding total elemental concentrations measured by pXRF at each moisture conditions. These models were developed both for the entire dataset (all soil layers combined, n = 113) and for individual soil layers (separately, n = 30 per depth). Stepwise multiple linear regression (SMLR) was also applied to assess predictive accuracy when incorporating all pXRF-determined elements as independent variables. For this, we applied the backward selection method35 as outlined in Pelegrino et al.10. The process began with a full model containing all variables, followed by the stepwise removal of the least statistically significant ones. The final model consisted of the remaining variables. In this study, variable removal was guided by the corrected Akaike Information Criterion AICc, as it is better suited for identifying the optimal model for predicting future observations36. The SMLR was selected as the multivariate modeling approach due to its suitability for datasets with a moderate sample size and a limited number of predictors, while retaining high model interpretability. In this study, the predictor selection guided by AIC, balances model goodness-of-fit against model complexity by penalizing the inclusion of unnecessary parameters37. Consequently, AIC-guided SMLR promotes more parsimonious models by excluding redundant or weakly informative variables, thereby helping reduce the likelihood of over parameterization and improving model generalizability. In addition, SMLR preserves a transparent linear framework in which regression coefficients directly describe the magnitude and direction of predictor effects, facilitating interpretation of relationships between pXRF derived elemental concentrations and soil properties. This interpretability is particularly important for field scale applications where understandings predictor contributions is essential for practical decision making. Although stepwise regression does not completely eliminate overfitting risk, the combination of a moderate predictor to sample ratio and information criterion based variable selection improves model parsimony and interpretability relative to unrestricted full approaches. To assess the predictive ability of pXRF for estimating soil pH and plant-available nutrients, SMLR models were developed using three different sets of input variables: (i) soil pH and OM alone, (ii) elemental concentrations measured by pXRF alone, and (iii) a combined dataset including both pXRF-derived elemental concentrations and soil pH and OM values. Model performance was assessed through coefficient of determination (R2) values and root mean square error (RMSE). The predictive strength of these models was further validated by fivefold and tenfold combined cross-validation, and R2 values from these analyses were reported. All statistical analyses were conducted using SAS 9.4, JMP 17.2.0, and Excel, at α = 0.05. Graphs were plotted using Excel, JMP, and PowerPoint. Results and discussion Soil chemical attributes and moisture distribution patterns Soil pH and organic matter (OM) exhibited clear stratification across the soil profile, with higher OM concentrations in the surface layer and a gradual decline with depth (Fig. 2). Similar depth-dependent patterns were observed for several nutrients and pXRF-detected elements, reflecting the influence of long-term soil-forming and management processes. Soil moisture conditions differed markedly among treatments, with field-moist (FM) samples exhibiting the lowest moisture variability, saturated paste (SP) samples showing the greatest water retention, and after-removal-of-excess-water (AREW) samples presenting intermediate moisture levels. Distinct moisture separation among soil layers was observed across all treatments (Fig. 2). Boxplot distributions of soil pH (a), and organic matter (OM) (b), soil moisture conditions (c), and soil available nutrients (d). The top panel shows pH and OM distribution by soil layer (in cm), with n ≈ 30 (a–b). The bottom left panel illustrates soil moisture across three conditions: FM (field moisture), SP (saturated paste), and AREW (after removal of excess water from SP), with n = 113 (c). The bottom right panel shows results from traditional wet chemistry, with a normalized dataset for the available nutrients, with n = 113 (d). Colored points represent different soil layers (in cm). The boxes indicate the interquartile range (25th–75th percentile), with whiskers extending to 1.5 times the interquartile range. Median values are marked with horizontal lines, and outliers are displayed as individual points beyond the whiskers. The distribution of available nutrients determined by wet chemistry varied considerably among samples, with several nutrients exhibiting skewed frequency distributions (Fig. 2). Descriptive statistics, including mean, median, and minimum-to-maximum ranges, are presented in Table 2 to characterize the reference dataset used for model calibration. The wide concentration ranges observed for nutrients such as K, Ca, and Mg indicate substantial variability in soil fertility conditions across the sampled profiles, providing a robust dataset for evaluating pXRF-based nutrient prediction models under contrasting soil conditions. Table 2Descriptive statistics of elements determined by portable X-ray fluorescence (pXRF) for each soil moisture condition and for their available fraction via traditional wet chemistry. Results are in mg kg−1.MgAlSiPKCaTiVCrMnFeNiCuZnAsRbSrZrBaDSMean10,68764,490282,79834416,17819,030474513810070436,16248.131.174.010.497336286797Median10,04464,582284,11233116,23414,588467913410070536,20448.031.074.010.095326291793Minimum504756,557211,02216710,40310,11039621054343531,24136.020.060.04.051216128561Maximum36,63574,082310,70499419,619119,125623419514185942,89368.043.089.025.01375353411063FMMean10,89556,692260,52727014,76116,74138861357964234,35948.032.482.410.1102298247750Median10,66656,550260,56825214,69613,14637891357964734,58248.031.078.09.099294250746Minimum304949,001188,918107850454961376194238216,76332.020.064.03.05115496544Maximum26,13463,902362,01280041,434104,9985029178126108243,69280.0190.0597.077.01485153121072SPMean575377,937297,52327315,67216,232459911610365033,92053.828.165.77.487235202717Median538277,649299,55025415,70212,819439511310165734,00754.028.066.07.086229209695Minimum372961,918236,96699928786233303846142228,51738.016.051.03.04915185498Maximum11,41091,665316,56075418,44793,673629617513779240,50375.044.082.018.01264222601237AREWMean898363,568272,47826714,88916,35339151228463534,03149.731.073.68.497267227797Median882760,446274,83625914,94412,76039611238364334,19050.031.072.08.097260230791Minimum319845,558192,285102874891092679834143928,59332.021.057.03.057186100542Maximum27,07288,100317,70879819,578107,055508017012676840,30574.045.091.024.01424652901192Bioavailable from traditional wet-chemistry performed in dry (fully processed) soilsMean430‒‒123882341‒‒‒‒‒‒0.750.17‒‒‒‒‒Median408‒‒83432060‒‒‒‒‒‒0.700.10‒‒‒‒‒Minimum156‒‒064760‒‒‒‒‒‒0.200.00‒‒‒‒‒Maximum1224‒‒5510065040‒‒‒‒‒‒1.301.40‒‒‒‒‒DS, dry soil; FM, field moisture; SP, saturated paste; AREW, after removal of excess water (from SP); ND; non-detected. The total number of observations (n = 113) includes all soil layers combined. ‒: non-applicable. Descriptive statistics of elements determined by portable X-ray fluorescence (pXRF) for each soil moisture condition and for their available fraction via traditional wet chemistry. Results are in mg kg−1. DS, dry soil; FM, field moisture; SP, saturated paste; AREW, after removal of excess water (from SP); ND; non-detected. The total number of observations (n = 113) includes all soil layers combined. ‒: non-applicable. The observed OM stratification is consistent with the accumulation of crop residues and organic inputs near the soil surface, coupled with limited downward movement of organic materials38. Similarly, the vertical distribution of soil pH suggests differences in buffering capacity and acidity-generating processes across soil depths. Variability in nutrient concentrations likely reflects the combined effects of mineralization, nutrient retention, and leaching processes operating throughout the soil profile. Elevated concentrations of P and K in surface layers (Fig. 2) are likely associated with repeated surface fertilizer applications, particularly under reduced-tillage systems where nutrient incorporation is limited. Higher concentrations of Fe and Mn near the soil surface may result from their inverse relationship with soil pH and from redox fluctuations that increase their solubility under periodically reducing conditions. In contrast, the decline in Ca and Mg with depth generally followed pH trends and may be related to their relatively greater mobility and susceptibility to leaching in well-drained soils. Overall, these patterns demonstrate the strong vertical heterogeneity of soil chemical properties and nutrient distributions, highlighting the importance of considering both soil depth and moisture condition when developing and evaluating pXRF-based nutrient prediction models. Descriptive statistics of pXRF analyses Prior to model development, pXRF elemental responses were evaluated across soil moisture conditions. Descriptive statistics of elemental concentrations measured by pXRF under four moisture conditions, DS, FM, SP, and AREW, were examined to identify differences in elemental behavior associated with soil processing, moisture content, and elemental mobility (Table 2). Zirconium (Zr) and barium (Ba) were consistently detected in all conditions (Table 2) given their known association with resistant mineral lattices and their generally low mobility in soils39,40. Silicon (Si) and aluminum (Al), major components of the soil mineral phase, exhibited high and stable concentrations across conditions, with slight reductions in SP and AREW attributable to dilution rather than dissolution. Their detection across all conditions underscores their low solubility, mainly Al, and strong association with solid phases such as clays and primary silicates41,42. Potassium (K) and Ca showed modest reductions in SP and AREW, reflecting their greater mobility compared to Si and Al. While their consistent detection indicates that a significant portion remains adsorbed or incorporated into sparingly soluble minerals, the observed variability suggests that these nutrients are partially solubilized and mobilized during water saturation and subsequent drainage. Transition metals such as iron (Fe) and manganese (Mn) typically exhibit relative stability in soils due to their strong association with oxides and hydroxides. However, under the AREW conditions, total concentrations measured via pXRF showed reducing trends. These patterns likely reflect redox-driven transformations during saturation and subsequent drainage. For example, Fe2⁺ formed under reducing conditions may have been preferentially mobilized and lost through leaching43, which may also explain Mn behavior within the soil matrix. Trace elements such as Zn, Cu, and nickel (Ni) were consistently detected, with only minor fluctuations in concentration. Their stability is likely to reflect strong associations with soil OM or mineral phases that limit their mobility44. These findings underscore the importance of soil moisture conditions and sample processing in influencing elemental detection and distribution by pXRF. Such effects are particularly relevant when selecting predictor variables for machine learning models aimed at estimating soil available nutrients under field and laboratory conditions. While certain elements exhibited relatively stable concentrations across moisture treatments, pXRF responses were nonetheless affected by soil water content and hydrological state, potentially introducing systematic bias into nutrient predictions. Therefore, calibration procedures that explicitly account for moisture-related variability are essential to ensure the robustness and transferability of pXRF-based nutrient prediction models. A simple Pearson correlation was conducted for all elements detectable by pXRF under various moisture conditions. Notably, in our dataset, even under SP conditions, soil moisture rarely approaches 40% (Fig. 2), supporting the feasibility of using uncorrected pXRF data for nutrient assessment in many field contexts. Furthermore, applying the moisture correction using the equation Corrected value = (as-is measurement) / (1 − [moisture% / 100]), did not improve the correlation with DS (Supplementary Table S2). The results showed weak or no significant relationships between the DS readings and those from FM, SP, and AREW conditions (Supplementary Table S2). Therefore, applying a moisture correction for data normalization did not improve these relationships. The regression analyses indicate that certain elements, such as P, K, Ti, Mn, Fe and Rb, exhibit strong positive correlations across moisture conditions, suggesting consistent detection trends (Supplementary Table S2). In contrast, elements like Al and Si show variable trends, likely influenced by moisture-induced changes in both matrix effects and bulk density, which in turn impact X-ray fluorescence responses. Since pXRF reports elemental concentrations as weight percentages, fluctuations in sample density arising from differential compaction or expansion due to mineralogical factors like swelling clays can introduce inconsistencies in elemental readings. Weak trends for Cu, Zn, As and Ni (Supplementary Table S2) further highlight the complexity of moisture and density interactions with trace element detection. These findings underscore the necessity of controlling density variability in pXRF analyses, as inconsistencies in sample compaction can significantly influence elemental readings and data interpretation in soil studies. Regression models for predicting soil nutrient availability The study assessed the predictive capacity of regression models (Linear, Quadratic, Power, and SMLR) to estimate soil nutrient availability based on pXRF-derived elemental concentrations (without including the soil chemical attributes pH and OM) under different soil moisture conditions (DS, FM, SP, and AREW) (Supplementary Tables S3 and S4), first at the different soil depths with a limited number of samples (Supplementary Tables S4, S5 and S6), and then combining the various soil depths since differences in pH and OM across depths (Supplementary Table S3; Fig. 2) likely impact the nutrients availability and the soil matrix heterogeneity, thus capture a broader range. Phosphorus, K, Ca, and Mg exhibited variable predictive performance depending on soil depth and moisture condition (Supplementary Tables S3 and S4). For P, models based on individual depths showed limited accuracy, but combining data from all depths slightly improved the SMLR performance (R2 = 0.37 under DS). Potassium achieved higher predictive capacity (R2 = 0.54 under DS), indicating that integrating data across soil layers better captured K dynamics. Calcium and Mg models performed relatively well, especially under SP and DS conditions (R2 = 0.50‒0.90), reflecting their more stable association with exchangeable fractions. However, predictive accuracy declined under AREW, likely due to post-drainage variability and complex soil–water–cation interactions. The combined-depth approach consistently improved robustness and generalizability for these macronutrients compared with depth-specific models. Micronutrients (Cu, Fe, Mn, Zn) displayed weaker predictive power (R2 < 0.4), though combining depths marginally improved performance for Fe and Zn, which were then removed for further analysis. Variability in these elements likely reflects heterogeneous distribution, redox effects, and organic complexation that pXRF cannot fully resolve without additional covariates such as pH or OM. Overall, combining all-depth data enhanced model stability, increased sample size (n = 113), and simplified interpretation. As shown in Supplementary Tables S3 and S4, the integrated dataset approach, comprising all depths, generally improved model performance metrics relative to depth-specific models, providing more reliable predictions for major nutrients while acknowledging reduced accuracy for micronutrients. Compared with previous studies that emphasized surface soils or specific regions10,13,45,46, our results demonstrate the broader applicability of pXRF coupled with SMLR for field-derived soils under varying moisture conditions. While simple linear/quadratic and power models underperformed, SMLR effectively managed multivariate data without artificial inflation of R2 values. Field variability in soil chemistry and moisture likely constrained accuracy relative to laboratory-spiked samples34, emphasizing the need for future validation using larger, more diverse datasets. SMLR modeling with elemental concentrations from pXRF, soil pH, and organic matter The stepwise multiple linear regression (SMLR) analysis revealed distinct predictive capabilities for pH and soil essential nutrient availability based on different parameter combinations: (i) pH and organic matter (pH + OM), (ii) elements determined by pXRF, and (iii) their combination [pXRF + (pH + OM)] (Table 3). To address whether pH and OM introduced unnecessary complexity, we compared SMLR models built from the three predictor sets (pXRF-only, pH + OM-only, and pH + OM + pXRF). The combined predictor set reduced RMSE in most combinations (Table 3), indicating that routine soil properties and pXRF elemental concentrations provide complementary rather than redundant information. For clarity, only the major trends and strongest predictors are discussed here, while the complete SMLR equations are presented in Supplementary Table S7. Table 3Statistical parameters from stepwise multiple linear regression (SMLR) for predicting soil essential nutrient availability using (i) pH and organic matter (pH + OM), (ii) elements determined by portable X-ray fluorescence (pXRF), and (iii) their combination [pXRF + (pH + OM)].Soil condition(pH + OM)pXRF elementspXRF elements + (pH + OM)R2p-valueRMSER2p-valueRMSER2p-valueRMSEpH*DS**0.49 < .00010.780.47 < .00010.820.64 < .00010.67FM–––0.150.0141.030.54 < .00010.75SP–––0.56 < .00010.750.67 < .00010.64AREW–––0.190.00040.990.52 < .00010.75PDS0.59 < .00016.760.37 < .00018.60.68 < .00016.12FM–––0.140.018100.67 < .00016.25SP–––0.39 < .00018.350.63 < .00016.41AREW–––0.220.00029.480.67 < .00015.67KDS0.5 < .0001150.50.54 < .0001149.80.8 < .000199.6FM–––0.3 < .0001182.60.66 < .0001128SP–––0.74 < .0001113.10.81 < .000197AREW–––0.27 < .0001184.10.59 < .0001136.7CaDS0.57 < .00016720.49 < .00017510.73 < .0001540FM–––0.140.0001955.30.64 < .0001630SP–––0.59 < .0001670.20.77 < .0001500.7AREW–––0.100.022957.50.53 < .0001705MgDS0.48 < .00011360.6 < .0001122.70.75 < .000197.1FM–––0.170.0004172.90.59 < .0001123.6SP–––0.69 < .0001104.80.83 < .000179.6AREW–––0.160.004175.20.56 < .0001127.8CuDS0.150.00020.220.23 < .00010.210.38 < .00010.2FM–––0.130.020.230.3 < .00010.21SP–––0.4 < .00010.190.44 < .00010.18AREW–––0.20 < .00010.210.25 < .00010.21ZnDS0.32 < .00010.20.360.00080.210.44 < .00010.18FM–––0.170.0050.230.39 < .00010.19SP–––0.4 < .00010.190.48 < .00010.18AREW–––0.180.0010.220.37 < .00010.20RMSE, Root mean square error; DS, Dry soil; FM, Field moisture; SP, Saturated paste; AREW, After removal of excess water (from SP). *pH was excluded from its own prediction for obvious reasons; only organic matter (OM) was considered. –: Not applicable, as variables were determined from wet chemistry using the same processed sample (DS**). The total number of observations (n = 113) includes all soil layers combined]. Statistical parameters from stepwise multiple linear regression (SMLR) for predicting soil essential nutrient availability using (i) pH and organic matter (pH + OM), (ii) elements determined by portable X-ray fluorescence (pXRF), and (iii) their combination [pXRF + (pH + OM)]. RMSE, Root mean square error; DS, Dry soil; FM, Field moisture; SP, Saturated paste; AREW, After removal of excess water (from SP). *pH was excluded from its own prediction for obvious reasons; only organic matter (OM) was considered. –: Not applicable, as variables were determined from wet chemistry using the same processed sample (DS**). The total number of observations (n = 113) includes all soil layers combined]. pH For DS, the combination of pXRF elements with (OM) improved the R2 to 0.64, reducing the RMSE to 0.67, compared to lower predictive abilities when using either pXRF (R2 = 0.47) or (OM) alone (R2 = 0.49) (Table 3 and Fig. 3). The FM and AREW conditions showed weaker predictive power when using pXRF predictors alone, while the integration of (OM) significantly improved R2. Relationships between observed and cross-validated predicted values for soil pH, P, K, Ca, Mg, Cu, and Zn using the combined predictor set (pH, OM, and pXRF-derived elemental concentrations). For pH prediction, pH itself was excluded from the predictor set. Points represent samples from the Dry, FM, SP, and AREW moisture conditions. The solid diagonal line indicates the 1:1 relationship. Each panel reports the overall cross-validated R2 and RMSE calculated from all moisture conditions combined. Phosphorus (P) The highest predictive capability for P was observed in AREW conditions with pXRF + (pH + OM) (R2 = 0.67, RMSE = 5.67), whereas DS, FM, and SP showed slightly lower predictive values (Table 3 and Fig. 3). Potassium (K) The integration of pXRF + (pH + OM) significantly improved K predictions, particularly in DS (R2 = 0.80, RMSE = 99.6) and SP (R2 = 0.81, RMSE = 97) (Fig. 3), while pXRF alone showed strong predictive power in SP (R2 = 0.74) (Table 3). In contrast, FM and AREW exhibited weaker predictions using pXRF alone but improved with pXRF + (pH + OM) (R2 = 0.66 and 0.59, respectively). Calcium (Ca) and Magnesium (Mg) For Ca, the highest R2 values were obtained under SP conditions with pXRF + (pH + OM) (R2 = 0.77, RMSE = 500.7), followed by DS (R2 = 0.73) and FM (R2 = 0.64). The prediction of Mg followed a similar pattern, with the strongest predictive capability in SP (R2 = 0.83, RMSE = 79.6) and DS (R2 = 0.75) (Table 3 and Fig. 3). These results suggest that pXRF combined with pH and OM provides robust predictions for Ca and Mg across different moisture conditions. Copper (Cu) and Zinc (Zn) The prediction of Cu and Zn showed moderate success, with R2 values generally below 0.50. For Cu, SP conditions yielded the highest predictive power (R2 = 0.44, RMSE = 0.18), while Zn showed slightly better predictability under SP (R2 = 0.48, RMSE = 0.18) and DS (R2 = 0.44) (Table 3 and Fig. 3). The weaker predictability for these micronutrients may be attributed to their complex interactions with soil components, requiring additional explanatory variables beyond pXRF, pH, and OM. Additionally, the overall contents of soil available micronutrients were relatively very low, which may potentially result in poor prediction by pXRF. While earlier studies6,7 have highlighted the value of integrating spectral data with soil properties, our results uniquely show that combining pXRF-derived elements with conventional soil indicators (pH and OM) significantly enhances the prediction of multiple macronutrients (K, Ca, Mg, and P) under field conditions. This integrative modeling approach advances nutrient estimation accuracy beyond previously reported methods. Previous studies have demonstrated that combining pXRF with LIBS (Laser-Induced Breakdown Spectroscopy), NIR (Near-Infrared Spectroscopy), and visNIR (Visible and Near-Infrared Spectroscopy) technologies enhances the accuracy of predicting soil available nutrients, primarily because LIBS- and NIR-based methods can assess soil moisture, pH, and OM47–50. In our case, moisture conditions influenced predictive accuracy, with SP generally yielding the most reliable results. The study underscores the potential of pXRF as a rapid, non-destructive tool for nutrient assessment, particularly when combined with key soil properties. SP condition assumed to enhance homogeneity compared to a dry processed sample by reducing particle segregation, improving bulk density consistency, and mitigating surface roughness effects. This aligns with the recent findings of Suarez Romero and Light51. The presence of water in the SP helps distribute fine and coarse particles more uniformly, minimizing the impact of particle size variability on X-ray interactions. Additionally, increased moisture near saturation may improve sample homogeneity and reduce surface heterogeneity during pXRF analysis. However, moisture also affects XRF responses through attenuation and matrix effects, particularly for lighter elements, which can alter fluorescence intensity and elemental detectability14,16. Therefore, although SP conditions may improve analytical consistency in some cases, moisture related matrix effects remain an important limitation in pXRF measurements. While finely ground and well-compacted dry samples remain the gold standard for XRF precision, using samples at or near saturation percentage can significantly improve the reproducibility of field-based or rapid pXRF measurements by providing a more uniform and stable analytical matrix. Although achieving and maintaining exact SP conditions in the field is challenging due to drainage and soil heterogeneity, laboratory results suggest that approaching SP through controlled moisture adjustment, rather than field saturation, offers a practical pathway to enhance matrix consistency and reduce variability in pXRF readings. Figure 3 displays the actual versus predicted plots for soil-available nutrients under the four soil moisture conditions: DS, FM, SP, and AREW. The analysis included the combined predictors [pXRF + (pH + OM)]. Predictors of soil pH and nutrient availability The SMLR results identified key elemental predictors influencing soil pH and nutrient availability across different moisture conditions (Supplementary Table S7 and Fig. 4). The SMLR-based colormap (Fig. 4) summarizes the direction and consistency of predictors retained across the four moisture-condition-specific equations, rather than correlation magnitude. Thus, the figure should be interpreted as a model-selection consistency map: blue cells indicate predictors retained with positive coefficients, red cells indicate predictors retained with negative coefficients, and color intensity reflects whether the same directional effect was observed in 2, 3, or all 4 moisture-condition equations. Gray cells indicate predictors not consistently retained, selected only once, or retained with mixed coefficient signs across moisture conditions. Colormap summarizing consistent predictors of soil fertility attributes and their directional effects across moisture conditions. Results are based on AIC-selected SMLR models fit separately for the Dry, FM, SP, and AREW datasets using the combined predictor set. Blue cells (+) indicate predictors retained with positive coefficients, whereas red cells (−) indicate predictors retained with negative coefficients. Color intensity denotes the number of moisture-condition equations in which the same predictor was retained with the same sign: 2, 3, or 4 of 4 equations. Gray cells indicate predictors not retained consistently, selected only once, or retained with mixed signs across moisture conditions. Cell labels indicate the coefficient sign and the number of equations supporting that directional effect. For pH prediction, pH was excluded from the candidate predictor set. The frequent inclusion of organic matter in the predictive models indicates its central role in controlling soil pH variability across the study area, being retained with negative coefficients in all four moisture-condition equations (Fig. 4; Supplementary Table S7). This suggests that samples with greater OM tended to be associated with lower pH within the modeled dataset. Rather than implying direct causation alone, this relationship likely reflects the combined influence of organic acid production, microbial activity, and depth stratification52, because OM is typically concentrated in surface horizons where acidification processes may be more pronounced. Several pXRF variables were retained less consistently for pH. Silicon and calcium pXRF predictors showed positive effects in two of the four equations, which similarly reflects the findings of Sharma et al.6, whereas titanium and zinc pXRF predictors showed negative effects in two equations. These patterns indicate that pXRF-derived elemental signatures may help capture mineralogical or parent-material gradients associated with pH variation, but their effects were less universal than that of OM. Phosphorus availability was consistently associated with both OM and pH. OM was retained with positive coefficients in all four P equations, whereas pH was retained with negative coefficients in all four moisture-condition equations (Fig. 4; Supplementary Table S7). This pattern agrees with the role of OM in contributing to labile P pools and ligand-driven P mobilization, while also indicating that greater pH was generally associated with lower extractable P in this dataset53. The latter pattern may reflect the pH sensitivity of P sorption and precipitation processes, particularly across soils differing in mineral composition and depth. Among pXRF predictors, magnesium was positively retained in three of the four P equations, while potassium and manganese were positively retained in two equations. Rubidium and arsenic pXRF predictors showed negative effects in two equations. These predictors should not be interpreted simply as direct nutrient sources; rather, they likely serve as compositional proxies for mineral assemblages, weathering status, or parent material controls that influence extractable P. Potassium availability showed one of the clearest combined effects of routine soil properties and pXRF predictors. OM and KpXRF were retained with positive coefficients in all four K equations, while pH was retained with negative coefficients in all four equations. Titanium was also a consistent positive predictor of K across all moisture conditions. In contrast, zirconium showed a negative effect in all four equations, while aluminum, silicon, vanadium, and rubidium were negative predictors in three of the four equations. Strontium and barium were retained as negative predictors in two equations. The positive selection of KpXRF is expected because pXRF-derived K provides a direct elemental proxy for total or mineral-associated K pools. However, the consistent positive role of OM and negative role of pH indicate that exchange processes and soil chemical environment also modulate the relationship between total K signals and extractable K. The negative coefficients for Zr, Al, Si, V, Rb, Sr, and Ba may reflect dilution by mineral fractions, lithological contrasts, or covariation with less labile mineral pools. For calcium and magnesium, pH emerged as a consistent positive predictor, being retained in all four Ca and Mg equations. This agrees with the broader expectation that higher pH soils often have greater base-cation status. OM was also positively retained in all four Ca equations, whereas it was negatively retained in all four Mg equations. The positive Ca response to OM may reflect greater exchange capacity and cation retention in organic-rich samples. The negative OM effect for Mg, however, suggests that Mg availability in this dataset was likely influenced by depth and mineralogical gradients rather than OM retention alone, and/or competition with Ca for the same soil exchangeable sites. Among pXRF predictors, CapXRF was positively retained in all four Ca equations, confirming that pXRF-Ca was a robust proxy for wet-chemistry Ca. Vanadium was positively retained in three Ca equations, while strontium was negatively retained in all four. Titanium and KpXRF were negative predictors of Ca in three equations. For Mg, vanadium was a negative predictor in three equations, while KpXRF and silicon were negative predictors in two equations; aluminum and chromium showed positive effects in two equations. These results indicate that Ca and Mg predictions were controlled by both base-cation chemistry and broader mineralogical patterns captured by pXRF. The relationships for Cu and Zn were more complex, consistent with the generally lower predictability of these micronutrients, which suggests that these elements are more influenced by soil heterogeneity and local geochemical interactions13, requiring further refinement in predictive modeling. For Cu, pH was retained with negative coefficients in all four equations, indicating that higher pH was associated with lower extractable Cu. OM was also retained with negative coefficients in three of the four Cu equations. In contrast, KpXRF and ZrpXRF were positive predictors in three equations, while Mg, Mn, Fe, and Sr were positive predictors in two equations. Titanium and arsenic were negative predictors in three and two equations, respectively. These mixed geochemical associations suggest that Cu availability was influenced not only by pH-dependent solubility but also by sorption to mineral and organic phases, as well as by local compositional variability. For Zn, OM was the dominant positive predictor, being retained in all four equations. Rubidium was consistently negative in three equations, while KpXRF, titanium, and ZnpXRF were positive predictors in two equations and vanadium was negative in two equations. Unlike the other nutrient responses, pH was not consistently retained for Zn, suggesting that Zn availability in this dataset was more strongly linked to OM and compositional proxies than to pH alone. Overall, the SMLR colormap indicates that OM and pH were not arbitrary additions to the predictive framework but were consistently retained where they contributed meaningful soil chemical information. OM was retained in all four equations for pH, P, K, Ca, Mg, and Zn, although the direction of its effect differed among response variables. Soil pH was consistently retained for P, K, Ca, Mg, and Cu, with negative coefficients for P, K, and Cu and positive coefficients for Ca and Mg. In parallel, pXRF predictors contributed direct elemental signals for several nutrients, particularly KpXRF for K and CapXRF for Ca, while other elements such as Ti, Zr, Rb, Sr, V, and Si likely captured mineralogical, lithological, or depth-related variation affecting nutrient availability. These results support a hybrid modeling framework in which routine soil properties and pXRF-derived elemental concentrations provide complementary information for predicting wet-chemistry fertility attributes across moisture conditions. To examine pairwise relationships among model inputs and wet chemistry-derived soil fertility attributes, Pearson correlation coefficients (r) were calculated between each candidate predictor and each response variable. Predictors included pH, OM, and pXRF-derived elemental concentrations, whereas response variables included soil pH and available P, K, Ca, Mg, Cu, and Zn (for pH as a response variable, pH itself was excluded from the predictor set). Correlations were calculated separately within each moisture-condition dataset (DS, FM, SP, and AREW), and the mean Pearson correlation coefficient across the four moisture conditions was used to generate the heatmap (Supplementary Fig. S1). The color scale was fixed from − 1 to + 1, where negative values indicate inverse associations and positive values indicate direct associations. Numerical r values were displayed within each cell to show the magnitude and direction of each relationship. The correlation heatmap provides an initial overview of how routine soil properties and pXRF-derived elemental concentrations relate to wet chemistry fertility attributes across moisture conditions. Among all predictors, pH and OM showed the strongest and most consistent pairwise relationships with several response variables (Supplementary Fig. S1). Soil pH was negatively associated with available P and K, but positively associated with Ca and Mg, reflecting the strong role of soil acidity in regulating nutrient solubility, exchange reactions, and base-cation status. Organic matter was negatively associated with soil pH and Mg, but positively associated with P, K, and Zn, suggesting that OM contributed information related to nutrient retention, organic nutrient pools, and depth-related stratification. These relationships help explain why pH and OM improved the predictive performance of the combined models relative to pXRF-only models. In contrast, most individual pXRF elemental predictors showed weaker pairwise correlations with nutrient availability, generally with r values below those observed for pH and OM (Supplementary Fig. S1). However, several pXRF variables still showed meaningful associations with specific responses. For example, CapXRF was positively associated with available Ca, MgpXRF and MnpXRF showed positive relationships with some macronutrient responses, and RbpXRF and ZrpXRF tended to show negative associations with K or micronutrient responses. This is supported by the fact that, in actual soil chemistry (adsorption and fixation to clay minerals), Rb and K often react similarly during weathering.; however, as far as biological availability and uptake are concerned, the two elements are strictly competitive, yielding the distinct negative relationship54–56 These overall patterns suggest that pXRF elements can act both as direct elemental proxies and as indicators of broader mineralogical or parent-material gradients. Therefore, although the pairwise correlations alone do not fully describe the multivariate SMLR models, they support the interpretation that pH, OM, and pXRF predictors provide complementary information for predicting soil fertility attributes. Model performance for pH and nutrient prediction In this study, we employed both fivefold and tenfold cross-validation approaches to assess model performance. For each approach, the dataset was randomly partitioned into k equal subsets, where k = 5 or k = 10. In each iteration, k − 1 folds were used for training (80% for fivefold and 90% for tenfold), while the remaining fold (20% for fivefold and 10% for tenfold) was used for validation. This process was repeated k times, ensuring that each fold served as the validation set once. The final model performance was evaluated by averaging results across all iterations, providing a robust estimate of generalization ability. The cross-validation results (R2 values from fivefold and tenfold validation) provided insights into the predictive capabilities of pXRF-based models for soil pH and nutrient availability (Table 4). Overall, the models performed best for macronutrients such as K, Ca, and Mg, with validation R2 values exceeding 0.70 in SP conditions (Table 4). In contrast, micronutrients such as Cu and Zn exhibited lower predictive accuracy, with validation R2 values generally below 0.40, indicating greater variability and potential confounding factors affecting their measurement. Table 4R-squared values from fivefold and tenfold cross-validation analyses.VariableSoil moisture conditionK_5-fold R2K_10-fold R2TrainValidTrainValidpHDS0.670.580.660.58FM0.540.510.560.50SP0.660.650.660.62AREW0.590.490.550.49PDS0.680.630.680.62FM0.630.550.640.59SP0.630.570.630.56AREW0.730.670.730.65KDS0.800.700.770.70FM0.640.570.660.58SP0.800.760.800.76AREW0.660.610.700.63CaDS0.740.700.730.68FM0.620.570.620.59SP0.770.720.760.71AREW0.660.560.670.57MgDS0.760.690.740.70FM0.600.490.560.49SP0.830.790.830.79AREW0.590.470.560.46CuDS0.280.170.380.20FM0.310.130.310.16SP0.430.300.440.32AREW0.290.170.390.15ZnDS0.380.210.440.35FM0.430.360.410.36SP0.450.360.480.41AREW0.370.300.380.31DS, Dry soil; FM, Field moisture; SP, Saturated paste; AREW, After removal of excess water (from SP); Train, Training samples; Valid, Validation samples. The total number of observations (n = 113) includes all soil layers combined]. R-squared values from fivefold and tenfold cross-validation analyses. DS, Dry soil; FM, Field moisture; SP, Saturated paste; AREW, After removal of excess water (from SP); Train, Training samples; Valid, Validation samples. The total number of observations (n = 113) includes all soil layers combined]. For pH, model performance was moderate, with validation R2 values ranging from 0.49 to 0.65 depending on moisture conditions (Table 4). The strongest predictive accuracy was observed under SP conditions (R2 = 0.65), suggesting that maintaining a consistent moisture state improves the relationship between elemental composition and pH prediction (Table 4). This finding is particularly relevant for field applications, where moisture variability could impact pH estimations derived from pXRF readings. Potassium predictions were among the most robust, with validation R2 values reaching 0.76 in SP conditions (Table 4). This indicates that K content is relatively stable across different soil states and can be effectively predicted using pXRF under controlled moisture conditions. A similar trend was observed for Mg, which exhibited the highest predictive accuracy (R2 = 0.79) under SP conditions (Table 4). The strong model performance for these macronutrients suggests that pXRF can reliably estimate their concentrations, particularly in well-standardized moisture conditions. Conversely, Cu exhibited the lowest prediction accuracy, with validation R2 values not exceeding 0.32 at any moisture condition (Table 4). This suggests that Cu concentrations in soil are highly variable and may be influenced by additional factors such as organic complexation, redox conditions, or spatial heterogeneity in Cu-containing minerals. Zinc predictions performed slightly better but still exhibited relatively low validation accuracy (Table 4), particularly in DS conditions (R2 = 0.21), reinforcing the need for additional calibration and validation in micronutrient assessments. Cross-validation results indicate that models for pH, P, K, Ca, and Mg generally exhibit good generalization, with small differences between training and validation R2 values across both fivefold and tenfold cross-validation. For instance, pH in the SP condition showed minimal variation (fivefold: Train = 0.66, Valid = 0.65), suggesting model stability. In contrast, Cu and Zn displayed consistently low R2 values and large discrepancies between training and validation sets, particularly for Cu under DS conditions (fivefold: Train = 0.28, Valid = 0.17). These results suggest that the models for Cu and Zn may suffer from overfitting or weak predictive power, likely due to high variability in the data or insufficient feature representation. AREW conditions for Mg and Ca also exhibited moderate validation drops, implying some degree of model overfitting. Notably, tenfold cross-validation yielded slightly higher validation R2 values in some cases (e.g., Zn in DS: fivefold = 0.21, tenfold = 0.35), suggesting improved stability with a larger training subset per fold. These findings highlight the need for further refinement, particularly for micronutrient predictions, through feature selection, transformation, or alternative modeling approaches. Final considerations and future works This study demonstrates the potential of pXRF for predicting plant-available nutrients under different moisture levels; however, some limitations warrant consideration. The dataset comprised of 113 composite samples from agricultural soils in iPNW specifically eastern Washington, which constrains geographic and mineralogical representativeness and may limit transferability to other regions, and soil types and order. Moisture states were broad and standardized (FM, DS, SP, and AREW), yet natural field variability in bulk density, particle packing, surface roughness can alter X-ray scattering and spectral interferences, thereby producing element specific bias; particularly for lighter elements and those near pXRF threshold limits. While the sample size was sufficient for regression analyses, the relatively small number of observations within each depth specific dataset may increase susceptibility to overfitting and limit the robustness and transferability of some simple regression models. Future studies with broader sample sizes or more complex spectral inputs such as full pXRF spectra may benefit from applying advanced modeling approaches, including machine learning techniques. These methods could enhance predictive accuracy and help uncover latent relationships within elemental and soil property data, particularly when maximizing performance is prioritized over model simplicity. As a proximal sensor, pXRF is a promising tool for rapid assessment of total elemental composition. Its use for predicting plant-available nutrient pools must be context-specific and grounded in robust calibration with wet chemistry reference methods. Importantly, this study focused on optimizing pXRF based prediction of available nutrients across different soil moisture conditions, rather than on translating these predictions into fertilizer recommendations. Ongoing and future work is aimed at advancing site-specific nutrient predictability using pXRF data and linking sensor-based predictions with agronomic response models to support fertilizer decision making. These observations should be carefully considered when interpreting model outputs, particularly for elements with low bioavailable fractions. These efforts will advance pXRF’s potential as a rapid and cost-effective tool for precision agriculture soil fertility assessments. Conclusions This study underscores the importance of soil moisture conditions in the elemental detection capabilities of pXRF. As hypothesized, soil moisture significantly influenced elemental detectability, with mobile elements being more affected than immobile ones. Our findings demonstrate that pXRF shows strong predictive performance for macronutrients like K, Ca, and Mg, aligning with the objective of evaluating regression models for soil nutrient availability. However, micronutrients such as Cu and Zn showed lower accuracy, indicating the need for further refinement in model calibration. Moreover, we recognize that sample moisture content can significantly influence pXRF readings by attenuating X-ray signals and reducing measurement accuracy, especially for light elements like P. Additionally, incorporating soil pH and OM into regression models was found to improve predictive accuracy compared to models using pXRF data alone, confirming the second hypothesis. The influence of moisture conditions highlights the necessity for standardized sample preparation, particularly under specific moisture conditions, to enhance the consistency and reliability of pXRF-based soil analyses. Supplementary Information Below is the link to the electronic supplementary material. Supplementary Material 1 Acknowledgements This study was funded by the Washington Oilseed Cropping Systems (WOCS) and Washington Grain Commission (WGC) Abbreviations After removal of excess water Dry soil Field moisture Organic matter Stepwise multiple linear regression Saturated paste Author contributions JA, SC and DM contributed to the conception and design of the study. JA and DM organized the database. JA performed the statistical analysis. JA and DM wrote the first draft of the manuscript. JA and DM wrote sections of the manuscript. JA, SC and DM contributed to the methodology. JA and SC contributed to visualization. JA, SC, and DM contributed to the data validation and data curation. JA, SS and SS contributed to the resources. JA, SC and DM contributed to writing the first draft, reviewing, and editing. JA, SS and SS contributed to supervision, project administration, and funding acquisition. All authors contributed to the manuscript revision, and read, and approved the submitted version. Funding This study was funded by the Washington Oilseed Cropping Systems (WOCS) and Washington Grain Commission (WGC). Data availability Authors can make raw data available upon proper request after consulting the corresponding author. Declarations Competing interests The authors declare no competing interests. Footnotes Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. References Associated Data Supplementary Materials Supplementary Material 1 Data Availability Statement Authors can make raw data available upon proper request after consulting the corresponding author.